for loops with /bin/sh on command line.

Vincent Hoffman vince at unsane.co.uk
Sun Jul 8 16:47:28 UTC 2012


I'm sure I'm being dim, but why cant I do a for loop on the command line
using /bin/sh ?
am I suffering from too much use of bash and as such shouldnt expect it
to work?


banshee# for foo in 1 2 3 ; do echo $foo ; done
for: Command not found.
foo: Undefined variable.
banshee# echo 'for foo in 1 2 3; do echo $foo ; done' > bahh.sh
banshee# sh bahh.sh
1
2
3
banshee#



Vince


More information about the freebsd-questions mailing list