Creating basic shell scripts
As a system administrator, or sysadmin, there will be times when you want to run a series of commands more than once. You can do this manually by running each command every time; however, there is a more efficient way to do so, by creating a shell script.
A shell script is nothing more than a text file with a list of commands to be run, and a reference to the shell that will interpret it.
In this book, we will not cover how to use a text editor; however, we will provide three recommendations for text editors in Linux that could help:
- Nano: This is probably the easiest text editor to use for beginners. Lean, simple, and straightforward, you may want to start by installing it and giving it a try.
- Vi or Vim: Vi is the default text editor available in RHEL, included even in the minimal install, and in many Linux distributions. Even if you are not going to use it every day, it's good to familiarize yourselves with the basics of it as it...