NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: xsrc/54851 (.profile is not read by sh when using xdm or other login managers)

The following reply was made to PR xsrc/54851; it has been noted by GNATS.

From: Robert Elz <kre%munnari.OZ.AU@localhost>
To: Valery Ushakov <>
Subject: Re: xsrc/54851 (.profile is not read by sh when using xdm or other login managers)
Date: Wed, 24 Aug 2022 02:01:03 +0700

     Date:        Tue, 23 Aug 2022 21:12:47 +0300
     From:        Valery Ushakov <>
     Message-ID:  <>
 Finally, a comment, thanks - I was beginning to wonder if
 anyone was left paying attention to this PR/thread, and was
 considering sending a message to tech-userlevel (which I
 probably should do anyway).
   | ksh, bash and zsh seems to allow mixing login and -c.  I'd prefer we
   | follow suit.
 I don't have strong feelings either way, it just seems kind of
 weird (even perverted) to abuse the concept of being a login
 shell that way (thanks for the examples, but I had tested various
 shells already, and I know some behave like that).
 While I am here, a few other minor things I forgot to mention.
 The long name (to use with -o) will be "login" which it is in all
 other shells that have a long name version (bash is one which doesn't)
 except for ksh93, where the long name is "login_shell", but it still
 allows -o login (ie: abbreviated form) to work on the command line (which
 is the only place ksh93 allows this option to be set).
 Second, the 'l' flag will appear in $- (not in all shells which have
 the option) and can be used with the "set" command (but doing so is
 pointless, as the only place it is used is deciding whether or not to
 run the profile files - that decision is made before any external code
 is executed, so while it will be possible to "set +l" in a login shell,
 or "set -l" in an ordinary shell, the only thing that will alter is
 what appears in $-.    Not all shells allow -l to work with the "set"
 command (neither that nor the -o form) - even some shells that show its
 value in the output of "set -o" don't allow it to be altered by the
 set command.   This is a very peculiarly implemented option overall.
 Third, I haven't bothered to check how many (if any) other shells
 allow +l to prevent a shell which would otherwise be a login shell
 from being one, nor do I care .. to me that symmetry is important.
 (I haven't tested, as actually making a shell be a login shell, other
 than by use of -l is annoying to do (possible, just annoying) other
 than actually making it be a login shell for some user, and logging in,
 which is a very tedious way to test, and provides no mechanism for
 passing +l as an option anyway).

Home | Main Index | Thread Index | Old Index