User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Legacy and Other Languages section within the Software Development category of DaniWeb, a massive community of 456,428 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,581 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Legacy and Other Languages advertiser: Programming Forums
Views: 1198 | Replies: 3
Reply
Join Date: May 2007
Posts: 4
Reputation: peacesam is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
peacesam peacesam is offline Offline
Newbie Poster

Shell script

  #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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2005
Location: North of the equator, but south of anywhere it could get cold for long
Posts: 31
Reputation: mittelgeek is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
mittelgeek's Avatar
mittelgeek mittelgeek is offline Offline
Light Poster

Re: Shell script

  #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  
Join Date: May 2007
Posts: 4
Reputation: peacesam is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
peacesam peacesam is offline Offline
Newbie Poster

Re: Shell script

  #3  
Jun 8th, 2007
Thanks, im planning on doing this for linux
Reply With Quote  
Join Date: Aug 2005
Location: North of the equator, but south of anywhere it could get cold for long
Posts: 31
Reputation: mittelgeek is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
mittelgeek's Avatar
mittelgeek mittelgeek is offline Offline
Light Poster

Re: Shell script

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Legacy and Other Languages Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Legacy and Other Languages Forum

All times are GMT -4. The time now is 1:19 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC