When I run this command:
bjobs -r -P xenon -W | awk '{print $7}' | grep -v JOB_NAME |
cut -f 1 -d ' ' | xargs
in a terminal, all running JOB_NAMES are coming, but when I do this in per_script only JOB_ID are coming.
Perl script code is below:
@dummy_jobs = qx/bjobs -r -P xenon -W | awk '{print $7}' | grep -v JOB_NAME | cut -f 1 -d ' ' | xargs/;
What needs to be changed in Perl?
qx/.../
literals are very much like double-quoted strings. Specifically,$7
is interpolated, so you end up passing... | awk '{print }' | ...
.Replace
with
Or if you prefer, you can use
Another difference is that
qx
uses/bin/sh
instead of whatever shell you were using, but that shouldn't be relevant here.