4 ms·
Actually, I don't have that device in my normal shell, mksh, but the command works in bash? Is bash putting things in /dev? That seems rather... bad, to be hone
by rvense 6y ago
Actually, I don't have that device in my normal shell, mksh, but the command works in bash? Is bash putting things in /dev? That seems rather... bad, to be honest.
- dx87 6y agoBash isn't putting anything in /dev. It checks to see if those files exist (I've never seen them actually exist though), and if they aren't there, it just parses the string and creates a network connection as though they did exist.
- HelloNurse 6y agoBash is not even pretending such special files exist: /dev/tcp/somewhere is only an elegant syntactic shortcut for requesting a telnet-like network connected pipe in a context in which a filename is required. For the child process, it's just a file descriptor.
- rvense 6y agoI don't think it's elegant at all. Magically treating special strings in this manner seems like a violation of "everything is a file".
- sfuller808 6y agoplan9 awaits you