Shell Scripting makes system administration and web development easier through automation of batch tasks, reducing the risk of human error and decreasing the time it takes to execute the task.
When a machine is administered via a typing in commands, it is typically done so through the use of a “shell”. The shell provides a user interface into interacting with the system such as viewing the contents of directories and executing applications. Shells also provide a basic programming language which allows these instructions to be executed as a “script”, much like the script to a movie that guides the actors. Through these scripts system administrators can pragmatically execute a batch of tasks that would otherwise have to be done by manually typing out the commands. This allows the administrator to automate these tasks on a schedule or let the computer fill in the specific details.
The primary benefits of utilizing scripts are the reduction in human error, such as forgetting a command or typing it in incorrectly, and the ability to leverage the computer to do the routine work. An example of a task that an administrator may have to do would be renaming three thousand files in a specific manner like changing the first letter of the file to its capital equivalent. Such a task would take a human a long time to do manually and would probably lead to mistakes after a prolonged period. However, by utilizing shell scripting, the administrator could write a small script in a fraction of the time and have the computer do the work in a shorter time frame than the human could. These sorts of tasks may typically be single-use scripts, but administrators will also write scripts with a more general purpose, like as a backup process that allows them to set it up on an automatic nightly schedule.
Typically an administrator is free to use any programming language in which they wish to program the software. However, portability issues arise that any system the administrator wants the run the software on either has to have the necessary software libraries installed or be of a machine type that is capable of running the software. These issues may not be a concern should the administrator be dealing with only a specific set of systems, but an administrator may be dealing with various systems where the only common software among them is the shell, which occurs most frequently. This allows the administrator to write the shell script utilizing the portability of the shell to reduce overall effort of administering and maintaining the systems.