From the course: Red Hat Enterprise Linux 8 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Use shell scripting to automate tasks

Use shell scripting to automate tasks

From the course: Red Hat Enterprise Linux 8 Essential Training

Start my 1-month free trial

Use shell scripting to automate tasks

- [Instructor] This is a quick introduction to using Bash for automation. We cannot cover all of the details of Bash scripting in one video, so instead we'll focus on how to automate tasks using Bash. For this video, we'll discuss a script that keeps track of who is logged in at any given time, how long they've been logged in, and what they're running currently. This script is included in the exercise files for chapter two, in a directory named scripts. Go to your extracted exercise files directory and load the script into vi. I've copied the exercise files to both my VM host and rhhost1. I'm currently in rhhost1 since this is where I'm going to be using the script. View it by going to the chapter two scripts directory, and type vi userlog.sh, and hit Enter. This script starts with #!/bin/bash which called the correct shell interpreter. In this case, the bash interpreter. We then assign the path and name of the log…

Contents