awk andvariable interpolation
Is there a way that I can interpolate variable in the begin statement in awk?
All i am doing here is piping the output through an ls -ltr command and checking for all files from todays date in a directory with awk. Sure there is a way to do it in bash - but I am trying to figure out how to do it in awk. Code:
#!/usr/bin/awk -f |
In AWK, to pipe the output of a command into a variable:
command | getline [var]Here's your complete program: Code:
#!/usr/bin/awk -f |
Quote:
your awk output for $8 won't be quite what you expected. Cheers, Tink |
Quote:
Hi, welcome to LQ, And nice first post. ;} Cheers, Tink |
As per Tink's warning, you may have even been given this link before as why you should avoid
parsing ls. |
Hey - great work guys.
|
All times are GMT -5. The time now is 07:23 PM. |