How to fix this bug?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to fix this bug?
# 8  
Old 10-18-2013
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
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question