better awk
Posted: Fri Aug 19, 2005 11:16 pm
I wrote a small context to imitate awk operation
here is example:
is analog for:
here is the origin:
http://en.feautec.pp.ru/SiteNews/awklsp
here is example:
Code: Select all
(awk (read-file "/etc/passwd")
(set 'FS ":")
(rawk S
("^ro" (println (F 0) " " (F 2)))
("^daem" (println (F 2) " " (F 0)))))
Code: Select all
$ awk -F: '
/^ro/{print $1,$3}
/^daem/{print $3,$1}
' /etc/passwd
http://en.feautec.pp.ru/SiteNews/awklsp