General discussion


Awk in perl

By andrew.tan ·
$awksmd = "/bin/awk";
$datecmd = "/bin/date";
$temp = `$datecmd | $awkcmd '{print $5}'`;
print "$temp";

Does anyone know why the following perl code does not work. When I ran the perl script above it does not seem like awk is invoked.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

answer to awk problems

by dbeethe In reply to Awk in perl

I had the same type of problem...
Turned out it was because the $5 was being interpreted... Add \ (awkcmd '{print \$5}'"; and it will work... or at least it did for me.

Related Discussions

Related Forums