3 ms·
Do 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"
by oskarth 11y ago
Do 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...)