looza
July 16, 2008, 6:55pm
1
system ("$ssh '$perf_stats' < temp_pipe 2>&1 &");
I need to start and interact with my executable defined by perf_stats on a remote machine but not change my command line to that of the remote machine. temp_pipe is a node created by mknod -f temp_pipe
Ikon
July 16, 2008, 7:08pm
2
I assume $ssh contains the command your trying to run..
I have had problems with putting the var right in the system command.
I usually do this:
$mycommand = "somecommand";
#next line lets you verify the command is correct
print "Running Command: $cmd \n";
$cmd = "$mycommand $othervars < $whatever";
system($cmd);
or
$rtn = `$cmd`;
looza
July 16, 2008, 7:35pm
3
$ssh contains the command that connects the client with the remote host.
system ("$ssh '$perf_stats' < temp_pipe 2>&1 &");
I then use something like this:
system("$rsh '$cmd'" );
where $rsh is the rsh connection command and $cmd is the command I use to run on $perf_stats.
Aren't you missing the destination host names?
looza
July 17, 2008, 5:33am
5
the $rsh, $ssh contains that. for instance,
$ssh="ssh $USER@$HOST";
The @ symbol must be escaped in a double-quoted string unless you want perl to think it is an array and expand it into a scalar.
$ssh="ssh $USER\@$HOST";
The @ symbol must be escaped in a double-quoted string unless you want perl to think it is an array and expand it into a scalar.
$ssh="ssh $USER\@$HOST";