Issue
Code
#! /bin/bash
read -p "INterest " interest
read -p "Enter loan " loan
tot(){
total=$( bc -l <<EOF
scale=3
$loan + $interest^3
EOF
)
echo "$total"
}
tot
output INterest 12 Enter loan 12 ./eofp.sh: line 6: unexpected EOF while looking for matching `)' ./eofp.sh: line 15: syntax error: unexpected end of file
Solution
Your here document is terminated wrongly; either
- start the here document with
<<-EOF
and indent using tabs or - put
EOF
on a line without any other characters.
Answered By - l0b0 Answer Checked By - David Goodson (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.