The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-19-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
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?