`clear echo "testing calc" date echo -e "======================================" yc1=0 yc2=0 yc3=0 lol=0 tnd=0 lno=0 c1=0 c1b=0 c2=0 c2b=0 c3=0 c3b=0 bb=12 wt=100 con=768 rip=0 sw=0 echo "" echo "" echo -n "Please Enter Lot no. = " read lno
numeric=0; while [ $numeric -eq 0 ] ; do read -p "Please Enter Total Ends = " tnd ; if [[ $tnd =~ ^[0-9]+$ ]] ; then numeric=1 ; else echo "Error: No's Only, 4 Digits" ; fi ; done echo ""
numeric=0; while [ $numeric -eq 0 ] ; do read -p "Please Enter 1st Count = " yc1 ; if [[ $yc1 =~ ^[0-9]+$ ]] ; then numeric=1 ; else echo "Error: No's Only, 2 Digits" ; fi ; done
numeric=0; while [ $numeric -eq 0 ] ; do read -p "Please Enter Cones per Bag = " c1b ; if [[ $c1b =~ ^[0-9]+$ ]] ; then numeric=1 ; else echo "Error: No's Only, 2 Digits" ; fi ; done
numeric=0; while [ $numeric -eq 0 ] ; do read -p "Please Enter $((yc1))/s Count % = " c1 ; if [[ $c1 =~ ^[0-9]+$ ]] ; then numeric=1 ; else echo "Error: No's Only, 2 or 3 Digits" ; fi ; done
echo -e "$(($c1))% Ends for $((yc1))/s Count = $(($tnd * $c1 / $wt))" y1a=$(($bb * $c1 / $wt)) echo -e "No of Beam for $((yc1))/s Count = $y1a" echo -e "Ends per Beam = $((($tnd * $c1 / $wt) / ($bb * $c1 / $wt)))" y1b=$(($yc1 * $(($wt / $c1b)) * $con)) echo -e "Lenght of $((yc1))/s Count Cone = $y1b" echo "" ` This is part of a script. What I want is the output of the script should be saved on different directory in txt or pdf format in below mentioned form.
testing calculator
Sat Mar 5 02:44:16 EST 2016
Lot no. = 4566 Total Ends = 4800 Lenght of Lot = 12000
1st Count = 16
Count % = 100
Ends for Count = 4800
No of Beam = 12
Ends per Beam = 400
Lenght of Cone = 49152
Beams per Creel = 4
Creels Required = 3
Bags Required = 50
------------------ ------------------ Man. XXXXXXXX Man. XXXXXXX