Subject: Res: Solaris 10 - login shell error

From: [email-masked]
Date: Tue, 2 Sep 2008 09:34:55 -0700 (PDT)

Complementing the previous message. 
After some tests, I believed this is a Bug. 
When executed with option "-s -" the "sh" shell are executed , and not the shell on the /etc/passwd.

After remove the ".screenrc" I execute:

    SunOS cmartins:~> screen -s -
    SunOS \u:\w> ps
       PID TTY         TIME CMD
      6859 pts/5       0:00 ps
      6852 pts/5       0:00 sh
    SunOS \u:\w> echo $$
    6852

----- Mensagem original ----
De: "[email-masked]" <[email-masked]>
Para: [email-masked]
Enviadas: Terça-feira, 2 de Setembro de 2008 12:30:52
Assunto: Solaris 10 - login shell error

Hi all, 

I'm new with screen utils. I love it! 
A few days I'm using it over Linux machine without problems. 
Now I trying install over a Sun Solaris 10 (SPARC) and got a little problem.

Here is the information about the version:

# screen --version
Screen version 4.00.02 (FAU) 5-Dec-03

# cat /etc/release
                       Solaris 10 8/07 s10s_u4wos_12b SPARC
           Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                            Assembled 16 August 2007

# pkginfo -l SFWscrn
   PKGINST:  SFWscrn
      NAME:  screen - A full-screen window manager
  CATEGORY:  system
      ARCH:  sparc
   VERSION:  4.0.2,REV=2006.10.04.21.15
   BASEDIR:  /opt
    VENDOR:  http://www.gnu.org/software/screen/
      DESC:  screen - A full-screen window manager
    PSTAMP:  freeware20061004212406
  INSTDATE:  ago 29 2008 14:37
   HOTLINE:  Please contact the owners of this software
    STATUS:  completely installed
     FILES:       37 installed pathnames
                   7 shared pathnames
                  10 directories
                   1 executables
                1915 blocks used (approx)

Well , my problem is with "shell" parameter on the ".screenrc".
I put the shell to work with login shell "-" .
shell - 

In this sample, I using the user "cmartins":
> grep cmartins /etc/passwd
cmartins:x:198:106::/home/cmartins:/bin/bash

On my $HOME/.profile I add a command and this works fine when I login on the system. But when screen are started , a weird syntax error occur. 
This is my profile:
> cat .profile
    #
    # Copyright (c) 2001 by Sun Microsystems, Inc.
    # All rights reserved.
    #
    # ident "@(#)local.profile      1.10    01/06/23 SMI"
    stty istrip
    PATH=/usr/bin:/usr/ucb:/etc:.
    export PATH
    vSO=$(uname)

I just add the "vSO" variable.
When screen are started this message appear:
    :screen (-): -
    -: syntax error: `vSO=$' unexpected

If I remove the ".screenrc" file and start screen with "-s -" parameter, the same error occur.

BTW: I have the same commands of the profile and .screenrc running on a linux 
machine without problems.

________________________________
Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua cara @ymail.com ou @rocketmail.com.

      Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua cara @ymail.com ou @rocketmail.com.
http://br.new.mail.yahoo.com/addresses

_______________________________________________
screen-users mailing list
[email-masked]
http://lists.gnu.org/mailman/listinfo/screen-users

---

From: "Andy Harrison" <[email-masked]>
Date: Thu, 4 Sep 2008 09:58:59 -0400

>     SunOS cmartins:~> screen -s -

I don't believe it's a bug. If you consult the manpage, it says:

   * If the command begins with a '-' character, the shell will
   * be started as a login-shell.

So you've got the preceding '-' character, but no command
following it.

- --
Andy Harrison
public key: 0x67518262

---

From: "Tom Scogland" <[email-masked]>
Date: Thu, 4 Sep 2008 11:04:56 -0400

Perhaps 'shell -$SHELL' would be more what you're after?
On Thu, Sep 4, 2008 at 9:58 AM, Andy Harrison <[email-masked]> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
>
> > When executed with option "-s -" the "sh" shell are executed , and not
> the
> > shell on the /etc/passwd.
> >
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (GNU/Linux)
> Comment: http://getfiregpg.org
>
> iD8DBQFIv+mkNTm8fWdRgmIRAujpAKCYFEouR1Ycvauyn7hqQAvi267A6QCdHN9+
> /7Tm2UGoqydWqacjH5U1l1U=
> =yLI6
> -----END PGP SIGNATURE-----
>
>

-- 
-N
AKA:Tom Scogland
I am enough of an artist to draw freely upon my imagination. Imagination is
more important than knowledge. Knowledge is limited. Imagination encircles
the world.
-Albert Einstein
_______________________________________________
screen-users mailing list
[email-masked]
http://lists.gnu.org/mailman/listinfo/screen-users

---

From: Micah Cowan <[email-masked]>
Date: Thu, 04 Sep 2008 09:31:41 -0700

> Complementing the previous message.

If you write a followup to a previous message, please do so by using the
"Reply" button of your mailer; this keeps the messages together in one
thread.

Also, are you aware that both of your messages were sent twice?

> the shell on the /etc/passwd.
> 

"-" is not the name of the shell, which is what -s (and the "shell"
screenrc command) expects. I'm somewhat surprised it works at all, but
I'm guessing screen just falls back to /bin/sh when the supplied shell
isn't valid (personally, I'd prefer a failure with a message).

If you want a login version of, say, ksh, then supply "ksh -".

- --
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer.
GNU Maintainer: wget, screen, teseq
http://micah.cowan.name/