As mentioned earlier, shell scripts can range from extremely basic to extremely complex. The example we reviewed earlier was a very simple script. It echoed text on the screen and ran one command. For your Linux+/LPIC 1 exam, you need to be able to create scripts that are much more complex than this. Therefore, in this part of the chapter, we’re going to cover the following topics:
• Displaying text on the screen
• Adding commands to a script
• Reading input from the user
Let’s begin by discussing how to display text on the screen in a shell script.
This task is pretty easy. As you saw in the earlier examples we reviewed, you can display text on the screen in a shell script using the echo ...