Re:Sockets in Your Shell
by dx87 on Thursday December 03, 2020 @08:01AM
(#25288396)
The man page for bash says that /dev/tcp and /dev/udp actually can be real files that any program can use, but that if they're absent, it emulates the behavior on its own.
[ Parent
| on HN ]
> The man page for bash says that /dev/tcp and /dev/udp actually can be real files that any program can use
But that's really just a bit of wishful thinking -- those files/directories don't exist on any mainstream UNIX OS I'm aware of.
Hey I'm the author. Yes, as far as I know it's just sugar for opening a socket, and there's almost never a file that exists. To treat it as a file, you need to assign a file descriptor to it, which you can then read and write from.