Linux.com

Network in shell

Posted by: Anonymous Coward on February 23, 2006 07:34 PM
AWK doesn't have any network capabilities. And it doesn't have to have them.

Try with bash something like that:

$ awk "...whatever..."<nobr> <wbr></nobr>/dev/tcp/www.intel.com/80

I routinely use shell as dumb curl/wget replacement. It's true that Perl normally ends up being the receiving side, but awk/sed are often used there too.

Also, on systems lacking bash with all the bells'n'whistles, I find it useful netcat utility: it's the good ol' cat but instead of files it works with sockets. With netcat you can turn any non-network capable shell tool into quite networkl capable one.

Something like that:

$ ( echo -e 'GET / HTTP/1.0\r\n\r\n'; \

    while read &2 $AAA; done \

    ) | netcat www.intel.com 80

After all, it's Unix we are talking about<nobr> <wbr></nobr>;-)

#

Return to CLI Magic: Learn to talk awk