Answer the question
In order to leave comments, you need to log in
Getting tail from screen?
FreeBSD 8.
There is screen already running, doing something there (run as -dmS without -L logging).
Is it possible to rip out the last few lines of output from it with a script? :)
The option with manual screen -x…, copy&paste, С+ad is not considered. Restarting screen with -L is too late, there are a lot of them, and they work with might and main.
Thanks in advance.
Answer the question
In order to leave comments, you need to log in
You can send any command to any window of any screen. Oh, how I wrapped it)
screen -S name -p 0 -X hardcopy
screen -S name -p 0 -X stuff 'ls -l^M'
stuff is screen's internal command to supply text to screen's input ... Will be sent to the null window screen with the name name command ls -l. ^M is needed instead of pressing Enter. ^M is not just printed, but inserted as an escape sequence, you can get it like this: Ctrl-v Ctrl-m and the character will appear.
Or you can write it like this: screen -S name -p 0 -X stuff 'ls -'`echo -ne '\015'` .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question