Possible /bin/sh Bug?

Tim Daneliuk tundra at tundraware.com
Tue Jun 5 15:41:26 UTC 2012


Given this script:
#!/bin/sh

foo=""
while read line
do
   foo="$foo -e"
done
echo $foo

Say I respond 3 times, I'd expect to see:

-e -e -e

Instead, I get:

-e -e

Linux appears to do the right thing here, so this seems like it
is a bug ... or am I missing something?



-- 
-----------------------------------------------------------------------
Tim Daneliuk


More information about the freebsd-questions mailing list