Re:Bringing the Unix philosophy to the 21st century (2019)
by cle on Sunday August 22, 2021 @04:26PM
(#28269264)
I use this occasionally in Emacs with awk-mode to live edit awk programs against a data file:
Re:Bringing the Unix philosophy to the 21st century (2019)
by xelxebar on Sunday August 22, 2021 @09:54PM
(#28271602)
What about something like
while inotifywait --event modify,move_self,delete_self script.awk; do awk -f script.awk input.txt; done
in a tmux pane on the right with vim/emacs/whatever on the left?Note: You need to watch the move_self and delete_self events, since editors might use some file move/deletion dance instead of a direct modify to help prevent data loss in the event of a crash.
Re:Bringing the Unix philosophy to the 21st century (2019)
by kbrazil on Sunday August 22, 2021 @10:25PM
(#28271745)
I wrote something similar to this to query JSON and JSON lines with python instead of awk for text. It’s called Jellex (Jello Explorer) which is a TUI front-end to Jello. Jello is a python analog to JQ.
What i would like is an cli awk ide. (Rolls of the tongue right? )
Ideally i could write ... | awk-ide "scripts/thing.awk" | ...
If it exists, run it. Otherwise have it open an editor session that runs an awk program as i type it on some buffered data, shows the result, and have some hints on what syntax/variables are available.