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 are the advantages of shell scripting?

984


What is the lifespan of a variable inside a shell script?

1575


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

2110


What is shell company all about?

934


Is cmd a shell?

957


Write a command sequence to find all the files modified in less than 2 days and print the record count of each.

1440


How does shell scripting work?

1052


What is the equivalent of a file shortcut that we have a window on a linux system?

1062


What is web script?

1029


Explain about non-login shell files?

1132


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

1370


How do you create a shortcut in linux?

1116


What does it mean by #!/Bin/sh or #!/Bin/bash at the beginning of every script?

998


What is shell variable?

861


i have 2 tables 4 colums table 1 respective values a1 6, a2 8,a3 9,a4 14 & table 2 respective values a1 6, a2 8, a3 9, a4 12. if compare 2 tables 3 colums values same then 4th column values 1)Qes diff >5 then (5 * diff value ) 2)Qes diff <5 the 5 3)Qes diff 5 then 5 print respective values..

2095