LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-30-2014, 11:13 PM   #1
ivahbee
LQ Newbie
 
Registered: Oct 2014
Location: i live in one of the isles in the South Pacific region.
Posts: 4

Rep: Reputation: Disabled
Question 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
 
Old 10-30-2014, 11:32 PM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Its your first line...

the one:
Code:
echo " "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
You have an extra " at the beginning....
 
Old 10-31-2014, 01:42 AM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,255

Rep: Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686
Please use [code][/code] tags when displaying code or data.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Run commands inside a terminal opened from a terminal.... charlemagne-is-my-son Linux - Software 10 06-16-2014 01:38 PM
how to run a terminal command that will open in a new terminal automatically floorripper Linux - General 5 06-18-2013 04:36 AM
make run command for each argument separately icegood Linux - Newbie 4 01-14-2013 10:35 AM
Compiled OpenVPN returns a Segmentation Fault when runned on an ARM Board Berris.Oliver Linux - Networking 7 02-23-2012 11:06 AM
bash script: run multiple jobs in bg, & kill them separately? mattengland Programming 1 03-26-2006 06:07 PM


All times are GMT -5. The time now is 02:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration