Linux Today: Linux News On Internet Time.

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

Sep 30, 2009, 23:32 (1 Talkback[s])
(Other stories by Mitch Frazier)

"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

Related Stories: