screen-users
[Top][All Lists]
Advanced

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

Re: how to start screen from .bashrc


From: Software Groups
Subject: Re: how to start screen from .bashrc
Date: Wed, 20 Sep 2006 07:50:51 -0400

Hi,

I am using screen for two years in Solairs and Linux. Before adding it
to your start profile consider this case   also. Some time screen –x
will hung can't even accept break signal, in this case you can't even
get the shell prompt. Your locked, we need to login as super user and
kill the screen session.


I have small script as ws, I will run after my login.

============
[ -f /usr/local/bin/screen ] && {

       #Check for exisintg screen session
       SSID=`screen -ls | perl -lane 'print $F[0] if /^\s+\d+\.work\s+/ ' `

       if [ -z "$SSID" ] ; then
               # if empty create new screen
               screen -S work -s bash -T xterm -c $HOME/bin/.work-screenrc
       else
               # connect to exising one
               screen -xA $SSID
       fi

}
=============

On 9/20/06, Peder Stray <address@hidden> wrote:
On Wed, 20 Sep 2006, Henry Nelson wrote:

> On Tue, Sep 19, 2006 at 06:44:26PM +0200, Peder Stray wrote:
>> Remember that screen adds $STY to your environment, so you can test for
>> it:
>>
>> if [ -z "$STY" ]; then
>>     exec screen -dR
>> fi
>>
>> which would exec screen, attach to an already running or start a new
>> screen if you aren't already in one.  No problem there...
>
> Fantastic!  I've been looking for such a test.
>
> You wouldn't by chance have a translation for that into "csh",
> would you?  Also, with "csh", am I right to assume the test
> would go in ".login"?

Yeah, I guess .login would be the correct place for csh.  Long time since
I used csh (or tcsh), but I guess something like:

if ("$STY" != "") then
   exec screen -dR
endif

--
  Peder Stray


_______________________________________________
screen-users mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/screen-users



--
Software Groups (SFG)
http://www.sfgroups.com




reply via email to

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