I'm getting this above syntax error and i can't decipher what is wrong with it. I'm trying to do a float value in BASH.
Hence i used this command called the awk
to achieve the target.
while $empty; do
empty=false
echo -n "Price : "; read getPrice
#float value using awk
awk 'BEGIN{if ('$getPrice'>'0') exit 1}'
if [ $? -eq 1 ]; then
PRICE[$COUNT]=$getPrice;
else
empty=true
echo "Please put in the correct price figure!"
fi
done
However, i got this error
awk: line 1: syntax error at or near >
This error occured when i did not input any value into the getPrice
variable. However, it's working fine when i input some value which is >0
. After much deliberation, i still could not figure what is wrong with the syntax. Regards.