Thursday, February 23, 2006
OK, so this is not so interesting, but I think there is a limit to the number of nested while loops I can put into a C shell script (at least in my OS X implementation of C shell). I am writing a script to run my simulations, and when I put three nested while loops into a fourth, my code would run without incident, but when it got to the end of the largest loop, it would only run once. I double checked everything, and then I wrote a little code that only looped and incremented four variables. Lo and behold, the same thing happened, and the largest loop only happened once. I haven't found any documentation online, so it could be limited to my particular setup, or it could be a general C shell limit. To fix it, I changed the largest loop to a if statement with a goto command to head up to the top of the other loops. If anyone has any information about this, let me know.