Question
Write another shell script named user_check.sh that takes a username as input. The script should check if the given user is currently logged into the system.
If the user is logged in, it should display: "[Username] is currently active on the system."
If the user is not logged in, it should display: "[Username] is not logged in.
Answer :
Word Count : 117
___ ___ _________ _____ ________ ______ ________ _____ ___ _____.
__________ ________ ________ _____ _______ _____.
_______ ________ _________ _____ ____ _________ _______ _______ _______.
___ ______ ________ ________ _________ ________ ______ _________ _______.
_________ ________ ________ _____ _______ ____ ______ ___ __________ ___ __________ _____.
___ ________ ___ ______ ____ _________ ________ _______ __________ _______.
__________ ______ ______ ________ _________ ___.
____ _____.
Skip in 10
Here is the shell script as per the requirements for Operating System Concepts & Networking Management Lab: ```bash #!/bin/bash echo -n "Enter username to check: " read username # Check if user is currently logged in if who | awk '{print
_______ ____ ___ _________ _________ _______ _______ _____ _____ ___ __________ ___.___ ___ _________ _____ ________ ______ ________ _____ ___ _____.
__________ ________ ________ _____ _______ _____.
_______ ________ _________ _____ ____ _________ _______ _______ _______.
___ ______ ________ ________ _________ ________ ______ _________ _______.
_________ ________ ________ _____ _______ ____ ______ ___ __________ ___ __________ _____.
___ ________ ___ ______ ____ _________ ________ _______ __________ _______.
__________ ______ ______ ________ _________ ___.
____ _____.
IGNOU ACADEMY
Your IGNOU journey, made easier.
- Solved Assignments
- Study Notes
- Guess Papers
- Question Papers
Continue Reading — It's Free
Sign in with Google to unlock more of this answer.
✓ Free access
✓ Unlock up to 60% of the answer
✓ No payment required
✓ Unlock up to 60% of the answer
✓ No payment required
Quick Google sign-in. No separate registration form.