I learned something today

a neat little bash trick.

Where previously I would have written:

echo foo | nc somehost 666

Now I know that I can do it purely in bash, with:

echo foo >/dev/tcp/somehost/666

There’s also a corresponding /dev/udp if tcp isn’t your thing.

Neat!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>