I am doing the following script to know if profit or loss from entered selling price and cost price as;
echo enter selling price
read sprice
echo enter costprice
read cprice
if [ $sprice -lt $cp ]
then
echo Loss
else
echo Profit
fi
All the time, it is returning Profit
, with an error code, like;
:~/shell$ sh shellb.sh
enter selling price
10
enter costprice
20
shellb.sh: 6: [: -lt: argument expected
Profit
what might be the reason, and how can I fix this?