Theoretically it would work if the devices were exposed as directories, not files (which is basically what /proc actually does for most things).
/dev/ttyS0 should really be /dev/ttyS0/{data, ctr, baud, parity, stopbits, startbits} (probably a bunch I'm forgetting).
Re:The Beauty of Unix Pipelines
by AnIdiotOnTheNet on Friday June 05, 2020 @10:56AM
(#23429260)
Congratulations, you've re-invented Plan9!
For networking, I don't think there's a particular reason it doesn't exist, but it's worth noting sockets are a little special and require a bit extra care (Which is why they have special syscalls like `shutdown()` and `send()` and `recv()`). If you did pass a TCP socket to `cat` or other programs (Which you can do! just a bit of fork-exec magic), you'd discover it doesn't always work quite right. And while I don't know the history on why such a feature doesn't exist, with the fact that tools like socat or curl do the job pretty well I don't think it's seen as that necessary.