-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Description
I see two issues with your for loops section.
- Typo; In your 1st example. You use "end" to end the for loop, that is wrong it should be "done".
- It would be better to show some working examples
Instead of this:
for name [in list]
do
statements that can use $name
doneHow about doing it this way:
for name in one two
do echo $name
doneExample output:
one
two
Anther for loop example:
more list.txt
one
twofor name in $(more list.txt)
do echo $name
doneExample output:
one
two
Currently a user of the can't just cut and past the code into there terminal to run. This way they can do that to test and learn how it works.
Also maybe add a read line section to the while loop section.
Example:
more list.txt | while read line
do
echo "$line"
doneThis kind of loop is good for varibles with spaces in.
I can do a pull request if you want and do it for you, just let me know.
Metadata
Metadata
Assignees
Labels
No labels