-1

I want to send some commands to windows command prompt using 'PERL' script. the command is: putty.exe -ssh -2 -l username -pw password "ip address" this command will open an SSH session (console)to the mentioned ip address (server) for me. after getting the new console, I want to pass commands to and perform operations in the new console.How can I do that as well?

Please help

1 Answers1

0

You can use 'system' or 'exec' command.

system:

@args = ("command", "arg1", "arg2");
system(@args) == 0
    or die "system @args failed: $?"

http://perldoc.perl.org/functions/system.html

exec:

exec '/bin/echo', 'Your arguments are: ', @ARGV;
exec "sort $outfile | uniq";

http://perldoc.perl.org/functions/exec.html

Please notice the difference between them.

tal.tzf
  • 128
  • 7