2 ms·
> In the limit, some shells (GNU Bash for sure, and I think also Korn shell?) support connecting to a remote TCP endpoint via the /dev/tcp/ special prefix. EDI
by yjftsjthsd-h 5y ago
> In the limit, some shells (GNU Bash for sure, and I think also Korn shell?) support connecting to a remote TCP endpoint via the /dev/tcp/ special prefix.
EDIT: I'm wrong; Solaris has a `/dev/tcp` but it doesn't do that (details below courtesy of the person who corrected me)
Original (incorrect) comment:
Forget the shell: I'm 90% sure Solaris implemented that exact feature directly in the operating system, so you should absolutely be able to do this without any additional software, assuming that it was implemented by this version.
- smackeyacky 5y agoWhat's the syntax to test it? I definitely have a /dev/tcp inside the Solaris VM, is there a way to point it to a particular port?
- jmillikin 5y agoSome light Googling[1][2] shows that Solaris's /dev/tcp is some sort of pseudo-device for configuring the system's network settings. For both the Bash and Korn shells, the syntax looks like this: $ cat < /dev/tcp/localhost/1234 with traffic being uni-directional. More complex (bi-directional) examples documented at <https://tldp.org/LDP/abs/html/devref1.html#DEVTCP https://tldp.org/LDP/abs/html/devref1.html#DEVTCP>. Tested on macOS: # in one terminal bash$ nc -l 1234 # in second terminal bash$ cat </dev/tcp/localhost/1234 # lines typed into the 'nc' terminal will be printed to # the other. [1] https://docs.oracle.com/cd/E19857-01/817-1836-10/perfplat.html https://docs.oracle.com/cd/E19857-01/817-1836-10/perfplat.ht... [2] https://www.ibm.com/docs/en/was-nd/8.5.5?topic=systems-tuning-solaris https://www.ibm.com/docs/en/was-nd/8.5.5?topic=systems-tunin...
- smackeyacky 5y agoThe modern incarnations (appending server and port numbers) to /dev/tcp in Solaris doesn't work. No matter. Very curious as to why ftp doesn't work, I think I have missed something on the Debian side of things to enable old school ftp clients. You can log in, but even setting the system to PASV does nothing. 500 Port Rejected is the error you get.