screen-users
[Top][All Lists]
Advanced

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

Re: How to execute a script inside of screen?


From: Stefan Mischke
Subject: Re: How to execute a script inside of screen?
Date: Thu, 14 Feb 2008 19:59:50 +0100
User-agent: Thunderbird 2.0.0.9 (Windows/20071031)


Phil Snowberger schrieb:
On Thu, Feb 14, 2008 at 04:42:07AM -0500, address@hidden wrote:
  
How can I execute a shell script inside of screen and keep the shell
open? If I do something like

screen -dmS myscreen ./myscript.sh

the screen session is terminated after "myscript.sh" finishes. Using
the "zombie" option in screenrc, I can at least see the output after
reattaching. But what I really want is to keep an interactive shell as
if I would start screen without any argument. 
    

You could make sure that myscript.sh runs 'exec bash' before
terminating, or just wrap myscript.sh in myscript-wrapper.sh, which
merely does

#!/bin/sh
./myscript.sh
exec bash

Is that what you're looking for?
  
Not exactly. It looks similar, but the shell environment which is started by "exec bash" is not the same one in which "./myscript.sh" is executed in. Joe's solution (see next mail in thread) is what I was looking for. Thanks.


reply via email to

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