Purpose

CCIS 2121 CCIS 2121 sed awk

In and we explored rudimentary shell scripting. Without some knowledge of Linux administration, however, it is of highly limited utility. The purpose of this module is to expand our knowledge of shell scripting. Leveraging our newly-gained knowledge of and and joining that to what we already know about logic and loops will allow us to automate virtually any task.

First, we must review what we've probably already forgotten about shell scripting. The components which have already been covered in shell scripting include:

Now that we've remastered the basics of shell scripting, it's time to start adding interactivity to our shell scripts. This portion will examine and explain how to built interactive programs for users, using shell. Again, we'll find that the advanced BASH scripting guide is an excellent resource.

I've added some sample scripts, to demonstrate some concepts.

setting some colors, using prompt escape codes
moving the cursor around with tput, and changing colors with escape codes
getting user input with a read
keeping a user in your shell script
show who is logged in, in green
a sample limited action menu
centering output on the screen
an arbitrary calculator and it\'s data
a highly modularized firewall script
an example of a case statement