I am trying to play around and understanding ttys. In one terminal emulator window, the output of tty gives me
$ tty
/dev/ttys010
So I figured if I write to this device, the terminal window will show the output. In a second window, when I run
$ echo "test" > /dev/ttys010
The first window shows the word "test" as expect. However, when I run
$ echo "test" | /dev/ttys010
I get no output in the first window. Why is this? I assume its because | redirects stdout to programs while > redirects output to files.
echo test | sudo pipe /dev/ttyx
– Pablo Bianchi Jul 04 '23 at 15:48| /dev/ttys010
is NOT an executable program expecting "test" on itsSTDIN
I/O stream, it's a device, which needs to be managed by a program.>/dev/ttys010
connects the device to theSTDOUT
I/O stream of the "echo
" program. A better explanation is available inman bash
. – waltinator Jul 04 '23 at 16:32