-----Original Message----- From: Simon [mailto:simon.parkes@btconnect.com] Sent: 28 August 2002 07:25 To: main@lists.alug.org.uk Subject: [Alug] Remote command execution..
Hi all, Is it possible to fire up ssh and run a remote command in a perl script, somthing like :
system("ssh <user>@<host>:/<command>");
the command would be system("ssh <user>@<host> <command>"); (or at least the ssh part is like that as I've not checked the perl system() command)
Would the above run the command then quit or stay logged in ?
It should return when the remote command returns and it's return code will be that of the remote command. Remember that for it to work without asking for a password you need to have a key-pair set up without a password on it or use ssh-agent to remember the password for the key.
Basicaly I need to run a script on a local machine and dependant upon results, run a script on a remote machine, then continue back with the script on the local machine.
Hope it makes sense..
TIA Simon
JD
_____________________________________________________________________ This message has been checked for all known viruses by the MessageLabs Virus Scanning Service