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";; esac 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.
More Articles by Tony Lawrence © 2012-06-19 Tony Lawrence
The easy confidence with which I know another man's religion is folly teaches me to suspect that my own is also. (Mark Twain)
Printer Friendly Version
How to run screen automatically? Copyright © March 2003 Tony Lawrence
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