-
Book Overview & Buying
-
Table Of Contents
Linux Essentials - Second Edition
By :
Conditional expressions are sometimes used in loops. Loops are structures that tell the script to perform the same task repeatedly until a particular condition is met (or until some condition is no longer met). For instance, Listing 11.5 shows a loop that plays all the .wav audio files in a directory.
The for loop as used here executes once for every item in the list generated by ls *.wav. Each of those items (filenames) is assigned in turn to the $d variable and so is passed to the aplay command.
The seq command can be useful in creating for loops (and in other ways too). This command generates a list of numbers starting from its first argument and continuing to its last one. For instance, typing...
Change the font size
Change margin width
Change background colour