in reply to Re^2: Get remote file TimeStamp
in thread Get remote file TimeStamp
The backticks "eat" one level of escapes, when they occur literally within the backticks. So, you either need to double escape them, or maybe better (to work around the ugliness), put the command in a variable, which you then interpolate into the backticks:
my $cmd = q|ssh -q aimuat perl -e \'\$MTIME = \( stat \( \"Envs_aimuat +.xml\" \)\)\[9\]\;print \$MTIME\;\'|; $TStamp = `$cmd`;
P.S., you can do away with the $MTIME variable if you use a "+" to syntactically disambiguate the argument to the print function:
my $cmd = q|ssh -q aimuat perl -e \'print +\( stat \( \"Envs_aimuat.xm +l\" \)\)\[9\]\;\'|; $TStamp = `$cmd`;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Get remote file TimeStamp
by Saved (Beadle) on Mar 01, 2012 at 11:21 UTC | |
by Eliya (Vicar) on Mar 01, 2012 at 12:49 UTC | |
by Saved (Beadle) on Mar 01, 2012 at 13:54 UTC |