screen-users
[Top][All Lists]
Advanced

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

Re: How to use screen configuration with command option


From: Chris Jones
Subject: Re: How to use screen configuration with command option
Date: Mon, 28 Dec 2009 10:10:37 -0500
User-agent: Mutt/1.5.18 (2008-05-17)

On Mon, Dec 28, 2009 at 08:38:35AM EST, address@hidden wrote:
> 
> On Mon, 28 Dec 2009 03:44:46 -0500, Chris Jones <address@hidden>
> wrote:

[..]

> > Do you mean something like this: 

> > $ ssh address@hidden
> > $ screen -S $HOSTNAME
> > $ screen -S $HOSTNAME -X hardstatus alwayslastline "Hello World!"
> > $ screen -S ..           <other screen command> ...
> > 
> > And this is not working in your case..??
> > 
> > CJ
> 
> Hello CJ,
> 
> [-X] is applicable for existing session only. I am running screen inside
> expect like

If you read the above sample carefully.. the first screen command starts
a screen session with name=$HOSTNAME. The second screen command executes
the 'hardstatus alwayslastline' screen command in that session. 

What am I missing?

> 
> ` ` `
> expect -c '
> 
> #for debug
> #exp_internal 1
> 
> #prevent Expect from printing out its interactions
> log_user 0

> spawn ssh '$ssh_Server' -t  "screen¹ -aUS '$ssh_Server' -dR bash -l
> ||echo 'screen not installed'"

> expect "*assword:"
> send '$PASSWORD'
> send "\r"
> interact'
> ` ` `
> 
> How can I use [-X] here ? 

I don't use expect very frequently, but doesn't the screen command¹
above start a screen session named $ssh_Server?

Add a /screen -S $ssh_Server -X hardstatus alwayslastline 'whatever"/
to your script and see if your screen session catches it.

CJ





reply via email to

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