943,853 Members | Top Members by Rank

Ad:
Jun 8th, 2007
0

Shell script

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
peacesam is offline Offline
6 posts
since May 2007
Jun 8th, 2007
0

Re: Shell script

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.
Reputation Points: 10
Solved Threads: 0
Light Poster
mittelgeek is offline Offline
37 posts
since Aug 2005
Jun 8th, 2007
0

Re: Shell script

Thanks, im planning on doing this for linux
Reputation Points: 10
Solved Threads: 0
Newbie Poster
peacesam is offline Offline
6 posts
since May 2007
Jun 8th, 2007
0

Re: Shell script

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.
Reputation Points: 10
Solved Threads: 0
Light Poster
mittelgeek is offline Offline
37 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Legacy and Other Languages Forum Timeline: RGSS / Ruby Game Scripting System
Next Thread in Legacy and Other Languages Forum Timeline: Euphoria





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC