4 ms·
I use Awk fairly regularly, in the form of actual scripts (not just expressions passed on the command line). Despite its age, it's still extremely powerful and
by woodruffw 11y ago
I use Awk fairly regularly, in the form of actual scripts (not just expressions passed on the command line). Despite its age, it's still extremely powerful and usually very pleasant to read and write. Gawk adds socket support, so writing network scripts is usually painless.
I've also been known to write Perl (5) and Tcl programs, but significantly less often nowadays.
- oskarth 11y agoDo you have some examples of network scripts written in Gawk? Particularly something that you'd prefer to write in Gawk rather than in a more "general-purpose" language. Would be interesting to see.
- woodruffw 11y agoHmm...I haven't published many of my Gawk scripts, but here's a simple little IRC bot using Gawk sockets: http://woodruffw.us/snippets#awkbot http://woodruffw.us/snippets#awkbot The general procedure for using a Gawk socket is just building a string of the form `/inet/tcp/0/example.com/80` (example.com, port 80) and redirecting to/from it as a coprocess with `|&`.
- chucky_z 11y agoCheck this out, I think you'll be impressed! https://www.gnu.org/software/gawk/manual/gawkinet/gawkinet.html#Simple-Server https://www.gnu.org/software/gawk/manual/gawkinet/gawkinet.h... (If you want it to fully function you'll need bits of code starting here -- https://www.gnu.org/software/gawk/manual/gawkinet/gawkinet.html#Primitive-Service https://www.gnu.org/software/gawk/manual/gawkinet/gawkinet.h...)
- AstroJetson 11y agoAdd me to the list of people that use Awk. It's my goto language for programs of less than 100 lines. I can do a lot in 100 lines. I've only used GAWK's network support a few times, mostly to write data collection on a set of boxes and then ship them to a central box for data presentation. For text data processing it's really hard to beat AWK.