The man page for screen says that I can create a detatched screen running with a set command in it by doing this:
$ screen -dm $command
However, it doesn't work. Screen exits without creating the detached screen.
If I say
$ screen $command
...I get dropped into a screen session running $command as I would expect.
What's the magic invocation I'm missing?
Also, the next step will be for root to launch said screen session as someone else during boot time; am I asking for trouble by trying it?
# su - user -c screen -dmS $Label $command
Thanks for any insights or pointers to web resources I can use to learn from.
On Tue, Jul 22, 2008 at 01:02:07PM -0400, David Mackintosh wrote:
The man page for screen says that I can create a detatched screen running with a set command in it by doing this:
$ screen -dm $command
However, it doesn't work. Screen exits without creating the detached screen.
screen -dm isn't the same as screen -d -m. Try the latter.
On Tue, Jul 22, 2008 at 06:07:44PM +0100, Luciano Rocha wrote:
The man page for screen says that I can create a detatched screen running with a set command in it by doing this:
$ screen -dm $command
screen -dm isn't the same as screen -d -m. Try the latter.
Figured it out.
While the first line of my shell script is
#!/bin/tcsh
...I am in fact a bash user. One of the things my script is ultimately trying to do is to start multiple things from within the screen session by use of teh screen command itself; because of the shell swap, $STY doesn't seem to be getting set. If I change the first line of my script to be #!/bin/bash, it works as expected.
Thanks for looking.
On Tue, 2008-07-22 at 18:07 +0100, Luciano Rocha wrote:
On Tue, Jul 22, 2008 at 01:02:07PM -0400, David Mackintosh wrote:
The man page for screen says that I can create a detatched screen running with a set command in it by doing this:
$ screen -dm $command
However, it doesn't work. Screen exits without creating the detached screen.
screen -dm isn't the same as screen -d -m. Try the latter.
Just an FYI...
You *may* be right, however...
"Standards" dictate that "flags" can be combined into a single parameter. This is "eased" (debatable IMO) by the "getopts" function in bash, getopt(1) command and getopt(3) function call for C et al.
Unfortunately, *some* few programs do not implement this correctly. But over the years, as programs have been "cleaned up" and replaced, their number has (thankfully) diminished.
<snip sig stuff>
I note the OP has solved it.
On Tuesday 22 July 2008, William L. Maltby wrote:
On Tue, 2008-07-22 at 18:07 +0100, Luciano Rocha wrote:
On Tue, Jul 22, 2008 at 01:02:07PM -0400, David Mackintosh wrote:
The man page for screen says that I can create a detatched screen running with a set command in it by doing this:
$ screen -dm $command
However, it doesn't work. Screen exits without creating the detached screen.
screen -dm isn't the same as screen -d -m. Try the latter.
Just an FYI...
You *may* be right, however...
"Standards" dictate that "flags" can be combined into a single parameter. This is "eased" (debatable IMO) by the "getopts" function in bash, getopt(1) command and getopt(3) function call for C et al.
You are right to the extent that posix getopt does indeed allow "-dn" as equivalent to "-d -n". But, _lots_ of programs use their own option parsing so assuming the above would be very foolish.
Unfortunately, *some* few programs do not implement this correctly.
That I belive is a major understatement...
/Peter