Shell scripts are an important tool in a system administrator’s toolbox. Whether you use them for automation, reporting, or just ad-hoc to process large volumes of repetitive work, it’s important to have an understanding of how to make scripts work for YOU. In this hands-on lab, we will take a look at shell scripts, including basic concepts.
**Red Hat Exam Requirements Covered:**
– Conditionally execute code (use of: if, test, [], etc.)
– Use Looping constructs (for, etc.) to process file, command line input
– Process script inputs ($1, $2, etc.)
– Processing output of shell commands within a script
– Processing shell command exit codes
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Create a script to add users in batches of 1 or more at a time.
- Add a user by hand, realize how much work it is
- Create a script that will add users in a batch from an input file
- Test the script works, and the desired results happen
- Add another key step to the user creation process to save more time
- Create a user deletion script
- Realize you’ll be deleting batches of users too
- Copy the create_users.sh script and make the changes
- Delete the recently added users