Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
For loop
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===1989: Bash=== {{Further|Bash (Unix shell)}} <syntaxhighlight lang="bash"> # first form for i in 1 2 3 4 5 do # must have at least one command in a loop echo $i # just print the value of i done </syntaxhighlight> <syntaxhighlight lang="bash"> # second form for (( i = 1; i <= 5; i++ )) do # must have at least one command in a loop echo $i # just print the value of i done </syntaxhighlight> An empty loop (i.e., one with no commands between {{code|do}} and {{code|done}}) is a syntax error. If the above loops contained only comments, execution would result in the message "syntax error near unexpected token 'done'".
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)