very desperate ... help on the "screen" command... - Setup

This is a discussion on very desperate ... help on the "screen" command... - Setup ; Hi all, I am trying to use the Unix/Linux command "screen" along with my long-running Matlab program. I am SSH to a remote Ubuntu Linux server. In the SSH shell, I typed "screen", then I got into "screen 0", and ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: very desperate ... help on the "screen" command...

  1. very desperate ... help on the "screen" command...

    Hi all,

    I am trying to use the Unix/Linux command "screen" along with my
    long-running Matlab program.

    I am SSH to a remote Ubuntu Linux server.

    In the SSH shell, I typed "screen",

    then I got into "screen 0", and I type "matlab -nodisplay",

    then it runs,

    then I type "CTRL a, c", I got into "screen 1",

    in this "screen 1", I type "CTRL a, d",

    and then I type "logout",

    then the connection was lost;

    --------------

    and I reconnect to the server,

    type "screen -r",

    It said no screen to be resumed...

    then I played around with it, it still did not give me back the original
    Matlab window where I have left ...

    ---------------

    then I made some new windows, with new Matlab's, etc.

    and played around with "CTRL a, d", etc.

    and logged out again, ...

    ----------------

    then I reconnect back,

    type "screen -r",

    sometimes it did not show anything,

    but sometimes it showed me some Matlab windows which was the one I left many
    sessions before -- that's to say, the Matlab session was not the one I have
    expected... it was the one I left out before many logouts and logins.

    I have never been able to obtain the Matlab windows that I expected to get.

    It looks to me that time plays a role in here:

    Suppose

    Step (1) I log on, do screen, open a Matlab, and detached, and log out;

    Step (2) I log on, do "screen -r" , expected to see the previous Matlab
    window -- but I couldn't. It said no screen to be resumed;
    Then I open another Matlab, and detached, and logout;

    Step (3) I log on, do "screen -r", it either said "no screen to be resumed"
    with 50% chance, or show me the Matlab window in Step (1) with 50% chance,
    but I am expecting the Matlab window in Step (2);
    Then I open another Matlab, and detached, and logout;

    Step (4) I log on, do "screen -r", it either said "no screen to be resumed"
    with 25% chance, or show me the Matlab window in Step (1) with 25% chance,
    or show me the Matlab window in Step (2) with 25% chance, or show me all the
    windows with 25% chance. But now I myself don't understand which window
    shall I expect at all.
    Then I open another Matlab, and detached, and logout;

    ---------------------------

    I continued, so on and so forth, it seems that the windows are all there,
    but it is just whenever I want the window, the window did not show up...
    what's wrong with this?





  2. Re: very desperate ... help on the "screen" command...

    In comp.os.linux.misc Mike wrote:

    [snip lots of screen stuff]

    I use this script (as ~/bin/sdr):

    #!/bin/sh

    if [ "$TERM" = screen ] ; then
    echo already running screen
    elif screen -d -r ; then
    true
    else
    exec screen
    fi

    If I am already running screen it lets me know,
    or if there is a detached screen it will reconnect me,
    or it will start a new screen session.



  3. Re: very desperate ... help on the "screen" command...

    Check out the screen example at here,
    http://lne.blogdns.com/lbe/archives/...l-with-screen/
    Mike wrote:
    > Hi all,
    >
    > I am trying to use the Unix/Linux command "screen" along with my
    > long-running Matlab program.
    >
    > I am SSH to a remote Ubuntu Linux server.
    >
    > In the SSH shell, I typed "screen",
    >
    > then I got into "screen 0", and I type "matlab -nodisplay",
    >
    > then it runs,
    >
    > then I type "CTRL a, c", I got into "screen 1",
    >
    > in this "screen 1", I type "CTRL a, d",
    >
    > and then I type "logout",
    >
    > then the connection was lost;
    >
    > --------------
    >
    > and I reconnect to the server,
    >
    > type "screen -r",
    >
    > It said no screen to be resumed...
    >
    > then I played around with it, it still did not give me back the original
    > Matlab window where I have left ...
    >
    > ---------------
    >
    > then I made some new windows, with new Matlab's, etc.
    >
    > and played around with "CTRL a, d", etc.
    >
    > and logged out again, ...
    >
    > ----------------
    >
    > then I reconnect back,
    >
    > type "screen -r",
    >
    > sometimes it did not show anything,
    >
    > but sometimes it showed me some Matlab windows which was the one I left many
    > sessions before -- that's to say, the Matlab session was not the one I have
    > expected... it was the one I left out before many logouts and logins.
    >
    > I have never been able to obtain the Matlab windows that I expected to get.
    >
    > It looks to me that time plays a role in here:
    >
    > Suppose
    >
    > Step (1) I log on, do screen, open a Matlab, and detached, and log out;
    >
    > Step (2) I log on, do "screen -r" , expected to see the previous Matlab
    > window -- but I couldn't. It said no screen to be resumed;
    > Then I open another Matlab, and detached, and logout;
    >
    > Step (3) I log on, do "screen -r", it either said "no screen to be resumed"
    > with 50% chance, or show me the Matlab window in Step (1) with 50% chance,
    > but I am expecting the Matlab window in Step (2);
    > Then I open another Matlab, and detached, and logout;
    >
    > Step (4) I log on, do "screen -r", it either said "no screen to be resumed"
    > with 25% chance, or show me the Matlab window in Step (1) with 25% chance,
    > or show me the Matlab window in Step (2) with 25% chance, or show me all the
    > windows with 25% chance. But now I myself don't understand which window
    > shall I expect at all.
    > Then I open another Matlab, and detached, and logout;
    >
    > ---------------------------
    >
    > I continued, so on and so forth, it seems that the windows are all there,
    > but it is just whenever I want the window, the window did not show up...
    > what's wrong with this?



+ Reply to Thread