awk - choose the newest file and use getline to read it -


There is a problem with a small awk script, I'm trying to select some log files for the latest and then Use the getline to read it. The problem is that if I do not send it to any script in the script it is okay.

This works

  echo | Myprog.awk  

this is not

  myprog.awk  

myprog.awk

  BEGIN {# Find the latest file command = "ls -alrt | tail-1 | cut-in 59-100" order | Getline logfile close (command)} while {(getline> > 0) {#do magic print $ 0}}  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -