Question: Creating a Bash Script File After you are satisfied with your hands-on log session in 8.1, create and execute a bash script using a text

Creating a Bash Script File

After you are satisfied with your hands-on log session in 8.1, create and execute a bash script using a text editor of your choice that does the following:

Scenario: Say that you want to check whether a specified user is on the system or, if not, to be informed as soon as the user logs in.

Write a script, uon, that will do this for you. In the uon script, use an until loop that will stop as soon as the loop condition is true (i.e. user of interest has logged onto the system). Pass the username as a positional argument.

Usage: ./uon

Write a script called uon that does the following:

Lists current date

Displays your username

Uses the until loop

Determines if a user has logged on

Informs you when the user logs in

Notes:

Run the script in the background so that you can do other work while waiting for user to log on.

Include a beep and message to inform you when the user has logged on.

Display all standard output to the file, result.

Provide a test run that shows a user has logged on (this may even be yourself if need be).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!