Redirecting shell command outputs to another konsole shell
First, look for the number that identifies the current tty session; lets consider the number as X
:
| terminal 1 | terminal 2 |
------------------------------------------------------
| $ tty | $ |
| /dev/pts/X | |
Then, use the given number to write to the tty selected:
| terminal 1 | terminal 2 |
------------------------------------------------------
| $ tty | $ echo "foo" > /dev/pts/X |
| /dev/pts/X | |
And it will produce:
| terminal 1 | terminal 2 |
------------------------------------------------------
| $ tty | $ echo "foo" > /dev/pts/X |
| /dev/pts/X | |
| foo | |
You can pipe the output to a log file which is tailed by other sessions.
In any other terminal:
touch foo && tail -f foo
In the "main" terminal:
script.sh > foo