6

Bash for loop

view full story
linux-howto

http://www.go2linux.org – A For loop is, as its name says a loop that executes certain code or commands for a given number of datum. From Wikipedia: for loop is a programming language statement which allows code to be repeatedly executed. A for loop is classified as an iteration statement. For Loop Syntax If you plan to use it in the command line, the best syntax to apply is: for: for NAME [in WORDS ... ] ; do COMMANDS; done Example: This for loop example will print all files in a given directory, in fact it will act almost the same a (HowTos)