APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

01/27/2003 05:40 PM unix "screen"

© March 2003 Tony Lawrence

01/27/2003 05:40 PM unix "screen"

I've been trying to figure out how to use screen automatically. I have used it myself manually: login, run "screen -D -R" and if I was previously disconnected I'm reconnected to whatever I was doing. If not, it just starts a new session.

But typical users don't want to type that - they just want to go into their application automatically. I thought that would be fairly easy, but so far it hasn't been. I must be missing something very basic.

I thought something like this would work as a logon script:

M=`screen -ls | wc -l`
echo $M
case $M in
  4) args="-D -R";;
  *) args="/usr/bin/myscript";;
eval screen $args

and it ALMOST does, but the first session of myscript doesn't get detached. I keep staring at this..

Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> 01/27/2003 05:40 PM unix 'screen'

Inexpensive and informative Apple related e-books:

Are Your Bits Flipped?

Take Control of Pages

Photos: A Take Control Crash Course

iOS 10: A Take Control Crash Course

Take Control of Parallels Desktop 12

More Articles by © Tony Lawrence

Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Printer Friendly Version

The easy confidence with which I know another man's religion is folly teaches me to suspect that my own is also. (Mark Twain)

Linux posts

Troubleshooting posts

This post tagged:


Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode