screen-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Logging in screen


From: Dan Mahoney, System Admin
Subject: Re: Logging in screen
Date: Thu, 13 Dec 2007 20:07:18 -0500 (EST)
User-agent: Alpine 0.99999 (BSF 796 2007-11-08)

On Thu, 13 Dec 2007, address@hidden wrote:

On Thu, Dec 13, 2007 at 10:11:20AM +0000, jan wrote:
I am trying to do something that I can't quite get my head around; I hope that 
somebody with more experience can help me.

This is what I try to do: I have a large number of serial ports attached to one of my linux boxes - I use them as consoles for the other UNIXes, which seems to work fine with minicom. I have set it up so I have a number of screen sessions start up in detached mode, each running a minicom connected to a serial port; this is not complicated, if a little fiddly.

Minicom runs an initialisation script through 'expect' - the script captures the log on prompt from the server at the other end, extracts the server name and saves in a file; I use this to correlate the screen sessions with server names.

What I want to achieve is the following:

1: I want to turn on logging in screen, but not until after minicom's expect script has run - otherwise the server's output seems to get caught in the screen log and not in the expect script. I have tried to achieve this by getting the script to send a "^A:", but this just goes straight to the serial line. Is there another way?

2: I also want to avoid logging the screen formatting codes - is there a way to achieve this?

I suppose I could find a way around both issues, eventually, but it would be nice not to have to.

/jan

You can send a command to a running screen session using screen -X.

You can either use "at" or "-p" to send commands to a specific window...at might be more flexible because I don't know if -p can take things like ttyname. Still, all you need is $ENV{WINDOW} to know for sure.

Read the manpage for the "at" command (screen's "at" command, not that of your OS) to be able to specify which window or windows those commands will apply to.

i.e. "screen -X 'at #2 log on'" or something similar. I haven't tried this since I keep my screens passworded. (Why one cannot send a command from WITHIN screen since obviously you could just ENTER it, I don't know...that's a better question for screen-dev).

Hope this helps.

-Dan

--

"You recreate the stars in the sky with cows?"

-Furrball, March 7 2005, on Katamari Damacy

--------Dan Mahoney--------
Techie,  Sysadmin,  WebGeek
Gushi on efnet/undernet IRC
ICQ: 13735144   AIM: LarpGM
Site:  http://www.gushi.org
---------------------------





reply via email to

[Prev in Thread] Current Thread [Next in Thread]