Whe runned separately,works! but combined: can't run terminal!
Please can someone help me, i can't seem to see where i went wrong!!
When i ran the script separately, it worked perfectly...output was correct.
But when i put the complete script together, it wont even output an answer.
It kept saying:
./cece.txt: line 64: unexpected EOF while looking for matching `"'
./cece.txt: line 67: syntax error: unexpected end of file
e.g.
echo " "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
echo "^ Employees Payroll Details ^"
echo "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
echo
echo "Employees Full Name:"
read emp
echo
echo "Numbers of Hours worked in a week:"
read hrs
echo
echo "Hourly Pay Rate:"
read hpr
echo
echo "Federal Tax Rate:"
echo 20%
echo
echo "State Tax Rate:"
echo 9%
echo
a=20
b=100
ftr=$(echo "scale=2;$a/$b"|bc)
c=9
d=100
str=$(echo "scale=2;$c/$d"|bc)
e=$ftr
f=$str
g=$hpr
h=$hrs
grosspay=`expr $g\*$h`
ftw=$(echo "scale=2;$ftr*$grosspay"|bc)
stw=$(echo "scale=2;$str*$grosspay"|bc)
Total_deduct=$(echo "scale=2;$ftw+$stw"|bc)
Deduction=`expr $Total_deduct`
Netpay=$(echo "scale=2;$grosspay+$Total_deduct"|bc)
clear
echo
echo "--------------------------------------------------"
echo "- Payroll Statement -"
echo "--------------------------------------------------"
echo
echo "Employees Full Name: $emp"
echo "Numbers of Hours worked in a week: $hrs hrs"
echo "Hourly Pay Rate: $ $hpr"
echo "Gross Pay: $ $grosspay"
echo "Deduction: $ $Total_deduct"
echo "Federal Tax withholding: $ $ftw"
echo "State Tax withholding: $ $stw"
echo "Total Deductions: $ $Total_deduct"
echo "Net Pay: $ $Netpay"
echo
|