Friday, February 17, 2012
udp/tcp connection using pure bash
hi guys, today i am going to show you how we can open tcp or udp connection to a server using pure bash technique. let us assume that the server ip address is 192.168.0.1 and the service which we are going to connect to is web server. it binds 80 port on server. at first we should open file descriptor that will point to the remote server and port.
here is the technique of descriptor opening by using only bash.
now we have 456 file descriptor which is associated with server 192.168.0.1 port 80. transfering data using this file descriptor is similar to writing data into the file :)
echo "GET / HTTP 1.0" >&456
in this example i used tcp protocol for communication. if you want to open a connection using udp protocol just point a file descriptor to udp device like this
that all folks.