I am writing a perl script to start vnc session.
Firsr I need to rsh to a server then load a module, next execute the “vncserver -otp”.
my $mod=`module load turbovnc-1.0.0; vncserver -otp 2> tmp_vnc.log`;
my $launch=`rsh $host /"$mod/"`;
print $launch;
But it does not work, any suggestions??
Thanks!!
Did you mean to use backticks in your first line?
This sets
$modto be the output of this sequence of commands, like runningfrom the shell. You probably wanted to say
which will set you up to run those specific commands on the remote host, and execute
It also looks like in the
rshcommand that you are trying to escape the quotation marks with forward slashes. In Perl (and in everything else as far as I know), use a backslash to escape a special character.