Re: multi-window searching, newer screen versions

Aaron Davies <[email protected]>
Newsgroups gmane.comp.gnu.screen.user
Message-ID <[email protected]>
On Aug 14, 2011, at 2:49 AM, Artur Skonecki wrote:

> On Sat, 13 Aug 2011, Aaron Davies wrote:
>> third is that this screen interprets "hardcopy -h" as "write a hardcopy of the current screen (without scrollback) to a file named "-h" (relative to screen's pwd). i'm not entirely sure how to fix that one,
> 
> If it is indeed the case, replacing hardcopydir with chdir command
> should suffice.

i'll give that a try

>> as i'm not sure how to get the number of windows in a screen back out to the script. (otherwise the brute-force way would be to iterate over them, generating the name variations myself.)
> 
> Are you trying to get the total number of windows in a session?
> You could consider counting the number of hardcopy files as an
> unreliable solution (Screen may be late with some of the files).

i was thinking of something like

for w in $(get window count here); do
 screen -S "$session" -X eval "hardcopydir '$HARDCOPYDIR/$session'" "at "#$w" hardcopy -h hardcopy.$w
done
-- 
Aaron Davies
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.