I would greatly appreciate feedback on four examples of screen use that
I would like to provide in a guide.  I'm a novice user, albeit over many
years.  What, if anything, can be done better with the four examples
below?  Comments on any aspect welcome.

Regards,
Lars

1) Here screen(1) is launched.

  ssh -l fred server.example.org screen

Once a screen(1) session is running, it is possible to detach it and
close the SSH connection without disturbing the background processes it
may be running. Then the terminal session can be reattached in progress.

  ssh -l fred server.example.org "screen -x"


2) Here ssh(1) is to assume that the connection is broken after 5
seconds of not being able to reach the server and to exit.

 while ! ssh -t f...@example.org -o 'ServerAliveInterval 5' \
   screen -d -RR; do true; done


3) try attaching to an existing screen session or if none exist, make a
new screen session

 /usr/bin/screen -x || \
   /usr/bin/screen \
      sh -c "/usr/bin/cu -s 19200 -l /dev/ttyUSB0 | \
      /usr/bin/tee /home/fred/consultant.log"


4) If the same account is going to share a session, then it's an easy
procedure. In the one terminal, where sessionname is the name of your
screen session, start a new session:

  screen -S sessionname

In the other terminal, attach to that session:

  screen -x sessionname

If two different accounts are going to share the same session, then the
following steps are necessary. user 1 does this:

  screen -S sessionname
^A :multiuser on
^A :acladd user2

Then user 2 does this:

  screen -x user1/sessionname


_______________________________________________
screen-users mailing list
screen-users@gnu.org
https://lists.gnu.org/mailman/listinfo/screen-users

Reply via email to