Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is option in shell script?

1064


Is bash an operating system?

1034


How can we find the process name from its process id?

1223


Is scripting and coding the same thing?

1041


What does $1 mean in bash?

1140


What is the default shell of solaris?

1089


How can you find out how long the system has been running?

940


Print the 10th line without using tail and head command.

2221


How do I run a shell script on a mac?

1187


Is powershell a language?

1087


How can I set the default rwx permission to all users on every file which is created in the current shell?

1475


How to debug the problems encountered in the shell script/program?

1200


What are the four fundamental components of every file system on linux?

1728


What are the different types of shell scripting?

1175


What is the significance of the shebang line in shell scripting?

1197