Reputation: 169
I need to get this command:
awk '{w=NF?$NF:w} END{print w}' file.log
in PHP
$land = system(" awk '{w=NF $NF:w} END{print w}' file.log");
I tried like this but PHP thinks that $NF
is a variable...
so I need the last field of a log file!
Upvotes: 0
Views: 44
Reputation: 1507
Escape the $NF "variable" like this
$land = system(" awk '{w=NF \$NF:w} END{print w}' file.log");
Upvotes: 1