TIL: #bash provides pseudo devices for TCP and UDP connections:
echo "hello" > /dev/udp/127.0.0.1/1337
or
exec 5<>/dev/tcp/www.google.com/80
echo -e "GET / HTTP/1.0\n" >&5
cat <&5
I'm baffled how I've never discovered that until today.
TIL: #bash provides pseudo devices for TCP and UDP connections:
echo "hello" > /dev/udp/127.0.0.1/1337
or
exec 5<>/dev/tcp/www.google.com/80
echo -e "GET / HTTP/1.0\n" >&5
cat <&5
I'm baffled how I've never discovered that until today.
Jonkman Microblog is a social network, courtesy of SOBAC Microcomputer Services. It runs on GNU social, version 1.2.0-beta5, available under the GNU Affero General Public License.
All Jonkman Microblog content and data are available under the Creative Commons Attribution 3.0 license.