//View Tip #196
» CDPATH
» Bash terminal size
» Check a bash script without executing
» Keeping your Home Directory Organized
Samus_
Similar Tips
» Get latest stable version of the Linux kernel» CDPATH
» Bash terminal size
» Check a bash script without executing
» Keeping your Home Directory Organized
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
#1
gawk does something similar with /inet/tcp see: http://www.gnu.org/software/ga … 2ftcp.html
Posted 2009-02-07 19:54:57

