Source-Changes archive

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

CVS commit: src/bin/sh



Module Name:    src
Committed By:   kre
Date:           Sun Sep 18 06:03:19 UTC 2022

Modified Files:
        src/bin/sh: main.c option.list options.c sh.1 var.c var.h

Log Message:
Add the -l option (aka -o login): be a login shell.   Meaningful only on
the command line (with both - and + forms) - overrides the presence (or
otherwise) of a '-' as argv[0][0].

Since this allows any shell to be a login shell (which simply means that
it runs /etc/profile and ~/.profile at shell startup - there are no other
side effects) add a new, always set at startup, variable NBSH_INVOCATION
which has a char string as its value, where each char has a meaning,
more or less related to how the shell was started.   See sh(1).
This is intended to allow those startup scripts to tailor their behaviour
to the nature of this particular login shell (it is possible to detect
whether a shell is a login shell merely because of -l, or whether it would
have been anyway, before the -l option was added - and more).   The
var could also be used to set different values for $ENV for different
uses of the shell.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/bin/sh/main.c
cvs rdiff -u -r1.9 -r1.10 src/bin/sh/option.list
cvs rdiff -u -r1.57 -r1.58 src/bin/sh/options.c
cvs rdiff -u -r1.249 -r1.250 src/bin/sh/sh.1
cvs rdiff -u -r1.80 -r1.81 src/bin/sh/var.c
cvs rdiff -u -r1.38 -r1.39 src/bin/sh/var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index