//View Tip #196
» Get latest stable version of the Linux kernel
» ssh proxy forwarding
» Splitting arguments with read
» Close shell keeping all subprocess running
Samus_
Similar Tips
» My code is compiling» Get latest stable version of the Linux kernel
» ssh proxy forwarding
» Splitting arguments with read
» Close shell keeping all subprocess running
Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
Don't have telnet or netcat handy for making a socket connection? Most Linux distros - not likely Debian - have this functionality built directly into Bash. The following will pull my site's index source on port 80, replace with any URL.
#!/bin/bash
exec 3<>/dev/tcp/kinqpinz.info/80
echo -e "GET / HTTP/1.1\nHost: kinqpinz.info;\nConnection: close\n\n">&3
cat <&3
Comments
Add your comment
Comments are currently disabled
#1
gawk does something similar with /inet/tcp see: http://www.gnu.org/software/ga … 2ftcp.html
Posted 2009-02-07 19:54:57

