Quote:
Originally Posted by
ken6503
to be honest, I don't know why.
when I first run the script I use:
sh scriptname
it gave me error.
when using ksh scriptname
I got correct result
Which version of sh and which operating system are you using?
Quote:
Originally Posted by
MadeInGermany
Many shell versions run a while loop in a sub shell so cannot set global variables.
When that while-loop is part of a pipeline, sure. But which shell runs a standalone while-loop in a subshell? Such an implementation seriously mitigates the construct's usefulness.
Regards,
Alister