[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Can Lua replace awk?
- From: steve donovan <steve.j.donovan@...>
- Date: Sun, 6 Mar 2011 17:26:07 +0200
On Sat, Mar 5, 2011 at 11:29 AM, Jeff Pohlmeyer
> Using Lua in a pipe like that feels a little awkward (no pun intended.)
As an admirer of AWK I would naturally sneak that kind of
functionality into Penlight...
If we have the following script on the path:
and given that executing ps gives me this:
PID TTY TIME CMD
1664 pts/0 00:00:00 bash
1815 pts/0 00:01:02 SciTE
1833 pts/0 00:00:07 SciTE
2040 pts/0 00:00:00 ps
$ ps | lf 'PID where CMD=="SciTE"'
New with this PL version is the ability to say $n etc. Note that the
AWK habit of auto-conversion happens (on a per-column basis)
$ ls -l | lf '$5/1024 where $5 > 1000'
Nota bene: it only _looks_ like SQL, these are actually Lua expressions.