Shutdown Scripts

Hi,

Recently I've created a script to shutdown a few hpux workstations and I found out that the script can only shutdown 1 workstation and then exit out from the loop without shutting down the rest of the workstation. The scripts is as below (brief one):

hcp_list="machine_a
machine_b"

for hcp_machine in $hcp_list; do

  remsh $hcp_machine '/usr/bin/shutdown -hy 0'

done

Please advise! Thanks!

Rgds,
Chin Soon

Replace

hcp_list="machine_a
machine_b"

with

hcp_list="machine_a machine_b"

Hi,

Actuall it was a typo mistake in my previous mail, it should be

hcp_list ="machine_a \
machine_b"

which is the same as :

hcp_list="machine_a machine_b"

And fyi, I'm using ksh to write this script.

Thanks!

Rgds,
Chin Soon

That loop works fine for me...

Comment out the line with "remsh" on it and place "echo $hcp_machine" under it and make sure the loop really is ending. It should execute twice...

Thanks! It works!