screen-users
[Top][All Lists]
Advanced

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

Re: Execute script in specific window


From: Peter Rait
Subject: Re: Execute script in specific window
Date: Mon, 21 Jan 2008 17:02:48 +0100
User-agent: Thunderbird 2.0.0.9 (Windows/20071031)

Geraint Edwards wrote:
 screen -p $zahl -X eval 'stuff ./run_node.sh" $zahl \015"'
> 
> When looking into the screen window it seems that now only the first 
> part './run_node.sh' is executed without passing the parameter.
  

This is a quoting problem - single-quotes are not interpolated.

That means:  the argument (to the screen command) that is in '...' will not
be scanned by the shell (script) for variables (etc) - and will appear
empty in this case (since $zahl is not in your environment, perhaps).

You need to do something like the following (to get the variable back out
of the quoting, so that it will be interpolated):

	screen -p $zahl -X eval 'stuff ./run_node.sh" '$zahl' \015"'

or, for more general such scenarios, a more bullet-proof version would be:

	screen -p $zahl -X eval 'stuff ./run_node.sh" '"$zahl"' \015"'

Hello Geraint,

Great!
It worked. Thank you for your quick solution.
I hope I can use this also on other platforms (solaris).

What I would also know is why the second solution

b) screen -p 1101 -X exec ./run_node.sh 1101

did not work out. It seemed more straightforward to me.
Are there some limitations of the exec command using preliminary window selection?

Regards
Peter

reply via email to

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