I'm trying to run the following command to ssh to a server and run my script and pass that script the values captured by this perl script, but when I run the script it does not pick up the actual variable values, it just simply prints out the actual words:
use warnings; use strict; my $arg0 = $ARGV[0]; my $arg1 = $ARGV[1]; my $arg2 = $ARGV[2]; my $arg3 = $ARGV[3]; my $arg4 = $ARGV[4]; my $arg5 = $ARGV[5]; my $arg6 = $ARGV[6]; my $arg7 = $ARGV[7]; system('D:\\SiteScope\\tools\\plink.exe -ssh user@server -pw Password +. ./scripts/myscript.sh $arg1 $arg2 $arg3');
I figure it's because perl interprets anything in between the single quotes as actual text and is not able to determine that the $arg1 $arg2 $arg3 are variables. How can I get this to work? I've tried everything I've read on this site. The command works as written and executes the remote shell script, it just doesn't pass the variable values to the script.
In reply to Using system to run exe on Windows and pass it variables by trmn8tr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |