for
Perform a command several times. More information: https://www.gnu.org/software/bash/manual/bash.html#Looping-Constructs.
- Iterate through command line parameters:
for ; do ; done
- Execute the given commands for each of the specified items:
for in ; do ; done
- Iterate over a given range of numbers:
for in }; do ; done
- Iterate over a given list of files:
for in ; do ; done
- Iterate over a given list of directories:
for in ; do ; done
- Perform a given command in every directory:
for in */; do (cd "$" || continue; ) done
- Use a C-style
forloop:
for (()); do ; done
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
