How shell uses for or while loops
This article will explain in detail how shell uses for or while loops. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
For/while cycle
For ((iTun0; I < 10; iTunes +)); do echo $i; donefor line in $(cat a.txt); do echo $line; donefor f in * .txt; do echo $f; donewhile read line; do echo $line; done < a.txtcat a.txt | which 1.rm commands are commonly used in while read line; do echo $line; doneshell to delete files; 2.echo refers to the display of specified text; 3.cat file name, output file contents to basic output; 4.cb, formatting source code 5.date, current time and date
This is the end of the article on "how shell uses for or while cycle". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.