in reply to Assign value of SHELL COMMAND to a variable in PERL
my $status = qx{ ssh r01mn1 /etc/init.d/hadoop-0.20-mapreduce-jobtrack +er status 2>&1 | awk '{print $3}'};
Be sure to put it before the pipe, otherwise you won't be piping anything to awk. Did that help at all?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Assign value of SHELL COMMAND to a variable in PERL
by ambrus (Abbot) on Jul 12, 2012 at 07:36 UTC | |
|
Re^2: Assign value of SHELL COMMAND to a variable in PERL
by rahulruns (Scribe) on Jul 12, 2012 at 06:56 UTC | |
by frozenwithjoy (Priest) on Jul 12, 2012 at 07:09 UTC | |
|
Re^2: Assign value of SHELL COMMAND to a variable in PERL
by jessarah (Initiate) on Jul 12, 2012 at 11:03 UTC |