---

More on Using Bash’s Built-in /dev/tcp File (TCP/IP)

“Before I go any further, let me state that this is based on
something I discovered here on Dave Smith’s Blog. All I’ve done
here is added a few improvements based on the comments to the
original post. I’ve also added a bit of additional explanation.

“The following script fetches the front page from Google:

exec 3<>/dev/tcp/www.google.com/80
echo -e "GET / HTTP/1.1 host: http://www.google.com
Connection: close " >&3
cat <&3

“Pretty simple, just 3 lines.”


Complete Story

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis