in reply to system call (backticks) with pipes
I am concern about using pipes in my system calls.
There's nothing special about pipes. There's something special about $, as they interpolate in backticks.
Since $3 is probably empty,
is the same asmy $day = `/bin/date | awk 'BEGIN {FS=" "}{print $3}'`;
my $day = `/bin/date | awk 'BEGIN {FS=" "}{print }'`;
Fix:
my $cmd = q{/bin/date | awk 'BEGIN {FS=" "}{print $3}'}; my $day = `$cmd`;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: system call (backticks) with pipes
by papai (Novice) on Jun 18, 2010 at 19:05 UTC | |
|
Re^2: system call (backticks) with pipes
by Anonymous Monk on Nov 17, 2016 at 20:28 UTC | |
by Corion (Patriarch) on Nov 17, 2016 at 20:26 UTC | |
by AnomalousMonk (Archbishop) on Nov 17, 2016 at 21:06 UTC | |
by hippo (Archbishop) on Nov 17, 2016 at 22:32 UTC |