Distributed Networks Distributed Networks

Unix Shell Scripts  «Prev  Next»
Lesson 4 Shell scripts within UNIX
Objective Shell scripts are used in standard UNIX system.
Default installation shell scripts
Describe how and where shell scripts are used in a standard UNIX system.
Every UNIX operating system includes numerous shell scripts as part of its default installation. These scripts are used for tasks such as:
  1. Initializing the system at boot time
  2. Stopping system services when shutting down the computer
  3. Alerting the system administrator to conditions that require attention
  4. Running programs for each user as the graphical mode starts
You might wonder why shell scripts are used for tasks such as these on a commercial operating system. The answer lies in the flexibility that UNIX provides to system administrators. Scripts are used for these tasks because a script can be reviewed to see what it does, and modified if needed to suit a particular user or system.Viewing system configuration scripts.
On most UNIX systems, many of the scripts used to manage the system can be viewed by any user on the system. By looking through the existing scripts on your UNIX system, you can see how professional-quality scripts are written. At first, most of the lines in a script won’t make sense to you, but as you learn more, you can review other people’s scripts to see how they accomplished certain tasks. At times, you can even use an existing script with modifications to suit your own purposes.
In this lesson’s exercise, you can see what a few sample scripts look like on the DistributedNetworks Lab system.
You can also try exploring your corporate UNIX system. On most systems you will have permission to read the scripts described in the exercise, though the locations may vary. It is a good idea to check with your system administrator first, however, so no one thinks you are being mischievous as you look around the system.
Scripts Within Unix - Exercise
Click the Exercise link below to review an example script.
Scripts Within Unix - Exercise
Next, you will learn about the difference between compiled and interpreted languages.