I have a serial port on a remote linux box which I can access over ssh.
I would like to create a file (not a real file, maybe a device file or unix domain socket?) which when written to writes to a remote serial port over ssh, and the reverse for reads.
I think it would be sufficient to have a command which creates a file, then makes the STDIN to the command accessible by reading from the file, and writes to the file would result in data output on the command's STDOUT stream. Then I could use it as such:
ssh user@host "cat /dev/ttyREAL" | <some_command> /dev/ttyFAKE | ssh user@host "tee /dev/ttyREAL"
Is there such a command, or am I going about it the wrong way?