I want to schdule shutdown with -t option but this option will prompt
me to answer "yes" or "no". How to go about putting in the yes in the
script?
Thanks in advance.
Something similar:
select CHOICE in yes no
do
case $CHOICE in
yes) shutdown ...;;
no) break;;
*) echo Invalid selection;;
esac
done
HTH,
Igor
--
Igor Pozgaj | ipozgaj at gmail.com (GTalk / MSN)
ICQ: 126002505 | http://fly.srk.fer.hr/~ipozgaj
PGP: 0xEF36A092 | http://ipozgaj.blogspot.com
fb, lfm, li, dA | http://twitter.com/ipozgaj
>On 2009-11-09, dolphin <yc28...@yahoo.com.sg> wrote:
>> Hi,
>>
>> I want to schdule shutdown with -t option but this option will prompt
>> me to answer "yes" or "no". How to go about putting in the yes in the
>> script?
>
>Something similar:
>
>select CHOICE in yes no
>do
> case $CHOICE in
> yes) shutdown ...;;
> no) break;;
> *) echo Invalid selection;;
> esac
>done
>
>HTH,
>Igor
I have not looked at AIX for a couple of years, but I seem to remember
a -y option (answer "yes" to all messages), of course that could be on
a different flavor, definitely on hp-ux.
Regards,
Ted.
==============================================================
| Ted Linnell <edli...@acslink.net.au> |
| |
| Nunawading, Victoria , Australia |
==============================================================
>I want to schdule shutdown with -t option but this option will prompt
>me to answer "yes" or "no". How to go about putting in the yes in the
>script?
/usr/sbin/shutdown is a ksh-script and simply does 'read ans'.
Try
yes | shutdown -t ....
cheers
Heinrich
--
Heinrich Mislik
Zentraler Informatikdienst der Universitaet Wien
A-1010 Wien, Universitaetsstrasse 7
Tel.: (+43 1) 4277-14056, Fax: (+43 1) 4277-9140
You might find it easier to use the 'at' command to run your job in the
future. For example, a remote command might be:
ssh remotesystem 'echo shutdown -Fr | at now'
Does a beautiful job of rebooting a remote system via an ssh command.
Not that ssh is required. Using at will also avoid the need to
interact with the command.
Barring that you can run 'yes | shutdown...'
from the HMC ?
Hi Heinrich,
Your solution works. Thanks a lot :)
shutdown -t now
Regards,
Niel