while
Simple shell loop that repeats while the return value remains zero. More information: https://www.gnu.org/software/bash/manual/bash.html#index-while.
- Read
stdinand perform an action on every line:
while read line; do ; done
- Execute a command forever once every second:
while :; do ; sleep 1; done
- Execute a command until it fails:
while ; do :; done
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
