General discussion

Locked

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.

1 total post (Page 1 of 1)  
| 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.

Back to Linux Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums