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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started