I am trying out a simple bash script using for loop, and kept getting the following error:
'/test.sh: line 2: syntax error near unexpected token `do
'/test.sh: line 2: `do
The following is the code that is being used...
for animal in dog cat elephant
do
echo "There are ${animal}s.... "
done
However, when I tried on other machines.. it is working no problem. Please help.
#!/bin/sh? I suspect its an inconsistancy between the shells that its running in. You know what they say... it's easier to port a shell than a shell script