Operating System - Linux
1828577 Members
2800 Online
109982 Solutions
New Discussion

What was /dev/tcp used for on RedHat Rel3?

 
James Brand
Frequent Advisor

What was /dev/tcp used for on RedHat Rel3?

It's not there on RedHat Rel4 and Tuxedo had been configured to use it on Rel3. All Google returns are some references to perl/shell programming tricks using this device file, such as

exec 3<>/dev/tcp/www.google.com/80
echo -e "GET / HTTP/1.1\n\n">&3
cat <&3

Obviously /dev/tcp is not needed or it would be there on Rel4. Does anyone know anything about /dev/tcp?

Thanks,
Jim
4 REPLIES 4
Ivan Ferreira
Honored Contributor

Re: What was /dev/tcp used for on RedHat Rel3?

See man bash:

/dev/tcp/host/port If host is a valid hostname or Internet address, and port is an integer port number or service name, bash attempts to open a TCP connection to the corresponding socket.

/dev/udp/host/port If host is a valid hostname or Internet address, and port is an integer port number or service name, bash attempts to open a UDP connection to the corresponding socket.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Steven E. Protter
Exalted Contributor

Re: What was /dev/tcp used for on RedHat Rel3?

Shalom Jim,

Hmmm. Driver for tcp?

They either built it into the kernel or used another name for it in RH 4.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Vitaly Karasik_1
Honored Contributor

Re: What was /dev/tcp used for on RedHat Rel3?


/dev/tcp supported iBCS2 emulation for supporting Solaris, etc. software.

It seems like recent 2.6 kernels doesn't support iBCS2 anymore.

http://www.linuxjournal.com/article/2809 Using iBCS2 Under Linux
James Brand
Frequent Advisor

Re: What was /dev/tcp used for on RedHat Rel3?

Our Tuxedo developers have gotten their code to work without using /dev/tcp. Thanks to all for responding. This was a strange one.

Jim