piątek, 28 sierpnia 2015

Redirect tcp to console (file) with awk

Sometimes useful, esp. when redirecting local tcp process output to console (file):

BEGIN {
NetService = "/inet/tcp/0/localhost/finger"
print "name" |& NetService
while ((NetService |& getline) > 0)
print $0
close(NetService)
}

More info @http://www.gnu.org/software/gawk/manual/gawkinet/gawkinet.html#Making-Connections

Brak komentarzy:

Prześlij komentarz