3 ms·
This is the best lisp version of the syntax I've been able to come up with: (awk (begin (set FS ":")) (cond (== $6 "/sbin/nologin") (print $1)) "/etc/passw
by DougBTX 15y ago
This is the best lisp version of the syntax I've been able to come up with:
(awk (begin (set FS ":")) (cond (== $6 "/sbin/nologin") (print $1)) "/etc/passwd")
Any better ideas?
(The awk macro itself is an exercise left for the reader...)
- groovy2shoes 15y agoI was just thinking about something like this. The beauty of Lisp stems from the fact that you can take it as-is (as a general-purpose language) and add constructs that allow for such domain-specific code. The converse, making awk more general, would be a much more difficult task.
- rapacity 15y agoin regard to ideas for better syntax there's an awk macro in scsh http://www.scsh.net/docu/html/man-Z-H-9.html#node_sec_8.2 http://www.scsh.net/docu/html/man-Z-H-9.html#node_sec_8.2