|
What is the difference between when it works and when it doesn't? To me they both look the same.
Your script, as copy+pasted from above, runs fine, although it never actually enters the loop, because $answer is 0. I get no complaints; and indeed, sh doesn't care whether you have explicitly defined a variable or not, and will not produce a complaint like the one you are reporting. Is it perhaps somehow being run by something else than /bin/sh?
|