This is a really handy feature that is unique to Linux/UNIX systems. It's most useful in scripts but can be used on the command line as well. If you have a system available try the given steps.
We show how to send the output from one terminal to another in the following steps:
In one terminal run the
tty
command. The output should be something like/dev/pts/16
.In the other terminal run the
route
command. You will see the output in that terminal.Now run
route
again, but now using the command:route > /dev/pts/16
The output will go to that other terminal.
Terminals on Linux systems are devices that have their own buffer space. By referring to the device by name you can write to it.
This feature is even more useful in scripts, which we will see in Chapter 8, Working with Scripts.