trmn8tr has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using system to run exe on Windows and pass it variables
by stevieb (Canon) on Sep 14, 2016 at 21:52 UTC | |
by trmn8tr (Initiate) on Sep 15, 2016 at 19:34 UTC | |
|
Re: Using system to run exe on Windows and pass it variables
by pryrt (Abbot) on Sep 14, 2016 at 21:25 UTC | |
|
Re: Using system to run exe on Windows and pass it variables
by kcott (Archbishop) on Sep 15, 2016 at 06:22 UTC | |
by trmn8tr (Initiate) on Sep 15, 2016 at 19:56 UTC | |
|
Re: Using system to run exe on Windows and pass it variables
by dasgar (Priest) on Sep 15, 2016 at 01:14 UTC |