Please support our Legacy and Other Languages advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: May 2007
Posts: 4
Reputation: peacesam is an unknown quantity at this point 
Solved Threads: 0
peacesam peacesam is offline Offline
Newbie Poster

Shell script

 
0
  #1
Jun 8th, 2007
Hi, I need some guidelines to start coding a shell script that will provide the administrator with the shutdown options :
-shutdown -now shutdown -h ?
-shutdown [time] , which i have no clue how to use a variable so the user can manually select a time to shutdown.
-shutdown (in minutes) , i know shutdown -t is for secs but what about minutes?

also, do i need to use a loop for this options? for example the user accidentally press the option 2 which is the shutdown time and he wanted to use option 1 instead.

Thanks in advance

sam
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 36
Reputation: mittelgeek is an unknown quantity at this point 
Solved Threads: 0
mittelgeek's Avatar
mittelgeek mittelgeek is offline Offline
Light Poster

Re: Shell script

 
0
  #2
Jun 8th, 2007
If your planning on doing this in Windows then try shutdown /? [XP & 2K3; not sure about 2K and I am almost positive that it is not native to NT]. It will save you some work.

If you plan on doing it in in *nix then I suggest reading the man pages and posting in the Linux *nix forum.
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4
Reputation: peacesam is an unknown quantity at this point 
Solved Threads: 0
peacesam peacesam is offline Offline
Newbie Poster

Re: Shell script

 
0
  #3
Jun 8th, 2007
Thanks, im planning on doing this for linux
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 36
Reputation: mittelgeek is an unknown quantity at this point 
Solved Threads: 0
mittelgeek's Avatar
mittelgeek mittelgeek is offline Offline
Light Poster

Re: Shell script

 
0
  #4
Jun 8th, 2007
Linux provides a full complement of switches to the shutdown command and many distributions provide aliases to many commonly used variants, e.g., reboot, poweroff, etc.

Unless you are trying to automate a shutdown/reboot I would have the Administrator take a look and the man pages.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Legacy and Other Languages Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC