mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-03-28 21:16:20 +01:00
for: add example for easy argument iteration (#15242)
This commit is contained in:
parent
36e829a5e6
commit
c715b82b67
1 changed files with 4 additions and 0 deletions
|
@ -3,6 +3,10 @@
|
|||
> Perform a command several times.
|
||||
> More information: <https://www.gnu.org/software/bash/manual/bash.html#Looping-Constructs>.
|
||||
|
||||
- Iterate through command line arguments:
|
||||
|
||||
`for {{variable}}; do {{echo $variable}}; done`
|
||||
|
||||
- Execute the given commands for each of the specified items:
|
||||
|
||||
`for {{variable}} in {{item1 item2 ...}}; do {{echo "Loop is executed"}}; done`
|
||||
|
|
Loading…
Add table
Reference in a new issue