Answer the question
In order to leave comments, you need to log in
How to make realtime log in terminal?
It is necessary that the working script spin and log messages to a predetermined place, and in another terminal they would be displayed as they arrive.
Considered solutions:
• Immediately write to the logging terminal.
The problem is that terminal numbers are created dynamically and you don't want to correct the main script every time you start it.
• Write to a file.
Then you have to write a viewing program with an infinite loop, tracking the difference, doing. I think it's fat for such a task.
• Pee into a pipe.echo “$message” > /dev/tty2
tty1: ping toster.ru > pipe
tty2: cat pipe
Answer the question
In order to leave comments, you need to log in
• Write to a file.
Then you have to write a viewing program with an infinite loop, tracking the difference, doing. I think it's fat for such a task.
mkfifo fileFIFO #создать файл(именованный канал) fifo
exec 4<>fileFIFO #открыть дескриптор файла на чтение/запись
echo Test1 >&4
...
echo TestN >&4
exec 4>&- #закрыть
cat fileFIFO
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question