On Mon, Dec 28, 2009 at 08:38:35AM EST, joyd...@infoservices.in wrote: > > On Mon, 28 Dec 2009 03:44:46 -0500, Chris Jones <cjns1...@gmail.com> > wrote:
[..] > > Do you mean something like this: > > $ ssh u...@host > > $ 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 _______________________________________________ screen-users mailing list screen-users@gnu.org http://lists.gnu.org/mailman/listinfo/screen-users