in reply to Shuting down servers

subhash_fire:

With no information about what OS you're trying to shut down, no mention of the command to do so, and no attempt to solve it on your own? This isn't a code-writing service, you should put in some effort, if only to ask a question.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Replies are listed 'Best First'.
Re^2: Shuting down servers
by subhash_fire (Novice) on Mar 15, 2011 at 11:56 UTC

    Thanks Mr. Roboticus i am sorry for the minimal information provided. I am using a window machine from that machine i need to login a linux based interface OA through ssh where i need to shutdown all servers at once. Instead of doing one by one which is time consuming.<\P> I tried using <code> @server = (1 .. 5); foreach (@servers) { exec ("poweroff server $_"); } <\code>

    Since I doesn't want the status of the command output for poweroff so used exec command. Is this info enough for you? Thanks in advance. <\p>

      subhash_fire:

      Better. So you have a "poweroff server" command that takes a number and shuts down the appropriate server? So I'm guessing that the poweroff command is not returning until the server actually shuts down.

      If that's the case, then perhaps the easiest way would be to use a batch file like:

      @echo off start poweroff server 1 start poweroff server 2 start poweroff server 3 start poweroff server 4 start poweroff server 5

      That way, the command shell can fire off the five poweroff commands in their own separate processes.

      ...roboticus

      When your only tool is a hammer, all problems look like your thumb.