[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Can Lua replace awk?
- From: Dirk Laurie <dpl@...>
- Date: Fri, 4 Mar 2011 19:39:31 +0200
On Fri, Mar 04, 2011 at 10:14:28AM +0200, steve donovan wrote:
>
> Thanks to my old friend awk, and a little editorial discretion:
>
I wondered why your new friend lua could not also do it.
E.g. to make a list of packages whose names start with liblua5.1
you can paste the following into a bash shell:
aptitude search liblua5.1 |
lua -e "print(table.concat((
function () t={};
for i in io.lines() do
table.insert(t,string.match(i,'liblua%S*'))
end return t end)(),' '))"
Dirk