Create a bash shell script that reads in a number from the
user. If the number is 1, print out the date. If the number
is 2, list the files in the current directory. If the number
is 3, print out who is currently logged onto the system. If
the number is anything else, print out an error message and
exit. Name this script "various.sh"
Answer Posted / aryan
cho "Enter Choice"
read num
case $num in
1) echo `date`
;;
2) ls
;;
3) who
;;
*) echo "Wrong option press 1 2 3 only"
;;
esac
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
What is the use of break command?
Write a shell script that adds two numbers if provided as the command line argument and if the two numbers are not entered throws an error message.
How do I save a powershell script?
What is shell and terminal?
Explain about non-login shell files?
What are the different types of shell scripting?
What is in a script?
What is sh in shell script?
What is a shell in operating system?
What is console line?
What language is shell scripting?
Why is used in shell scripting?
What is c in shell script?
what is info area how many types?
What is shell geeksforgeeks?