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

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`