1
0
Fork 0
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:
Managor 2024-12-26 09:02:09 +02:00 committed by GitHub
parent 36e829a5e6
commit c715b82b67
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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`