help with simple shell scripting
Hi,
I'm a Linux newbie, pls help me with this. I want a simple for loop to open N terminal windows (supposed to be input at runtime), I coded this way Code:
#!/bin/bash |
The complete error message should reveal the solution:
Code:
line 2: LIMIT: command not found Code:
LIMIT=10 Code:
read -p "How many terminal sessions? " ans |
Quote:
For the knowledge, space doesn't affect anything in the for loop, I can put either Code:
for ((a = 1 ; a <= ans; a++)) And I bet the best thing to ask is you have a link to a practical shell scripting for user (not admin)? :) |
Yes. It is a specific syntax of the for loop, that resembles the C loops and since in C there is not such a limitation (with or without spaces is the same) you are free to put them or not inside the double parentheses construct.
To learn shell scripting you can check: http://www.tldp.org/LDP/Bash-Beginne...tml/index.html (PDF available) http://www.tldp.org/LDP/abs/html/index.html (PDF available) For the command line in general: http://www.linuxcommand.org/tlcl.php |
All times are GMT -5. The time now is 12:53 PM. |