
Linux Command Line and Shell Scripting Techniques
By :

In the previous chapter, we started dealing with scripting, and we did a lot of learning about how scripts work and how they are structured. However, we missed a huge topic in scripting – influencing the order in which commands are executed when a script is run. There are a couple of things that we need to cover here, since there are multiple ways we can influence what is going to be the next command executed in a script.
We are going to start with a concept we call iterators or, more commonly, loops. There are a lot of things in everyday tasks that need to be done repeatedly, usually changing just one small thing in every iteration. This is where looping comes in.
We will cover the following recipes in this chapter:
for
loopbreak
and continue
while
looptest-if
loopcase
loopand
, or
, and not
Change the font size
Change margin width
Change background colour