Reputation: 5371
In a shell script I wrote following lines gave error during execution of script
if [ p -eq 35 -o p -eq 70 ]; then
echo "Sleeping ....zzz ........zzzz......."
sleep 5
get following error
/d2.sh: line 6: [: p: integer expression expected
Upvotes: 1
Views: 8836
Reputation: 602625
You probably want $p
instead of p
:
if [ $p -eq 35 -o $p -eq 70 ]; then
...
Upvotes: 2