tldr/pages/common/for.md

12 lines
227 B
Markdown
Raw Normal View History

2016-01-05 18:47:12 +00:00
# for
2016-01-13 11:04:46 +00:00
> Shell loop over parameters.
2016-01-05 18:47:12 +00:00
2016-01-13 11:04:46 +00:00
- Perform a command with different arguments:
2016-01-05 18:47:12 +00:00
`for argument in 1 2 3; do {{command $argument}}; done`
2016-01-13 11:04:46 +00:00
- Perform a command in every directory:
2016-01-05 18:47:12 +00:00
`for d in *; do (cd $d; {{command}}); done`