1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

(k)sh.1: invocation-related edits for clarity and completeness

This commit is contained in:
Martijn Dekker 2020-09-11 20:31:26 +02:00
parent b9d10c5a9c
commit 777dfa3e59

View file

@ -3940,8 +3940,8 @@ redefined for each instance.
.PP .PP
When a type is defined a special built-in command of that name When a type is defined a special built-in command of that name
is added. These built-ins are declaration commands and follow the is added. These built-ins are declaration commands and follow the
same expansion rules as all the special built-in commands defined same expansion rules as the built-in commands described below
below that are preceded by \(dg\(dg. These commands can subsequently that are marked with a \(dd symbol. These commands can subsequently
be used inside further type definitions. The man page for these commands can be used inside further type definitions. The man page for these commands can
be generated by using the be generated by using the
.B \-\-man .B \-\-man
@ -7054,7 +7054,7 @@ to fail or zero if no command has failed.
.TP 8 .TP 8
.B posix .B posix
Enable full POSIX standard compliance mode. This option Enable full POSIX standard compliance mode. This option
is on by default if ksh is invoked as \fBsh\fR. It is on by default if ksh is invoked as \fBsh\fR, \fBrsh\fR, or \fBpfsh\fR. It
disables passing exported variables' attributes (such as integer or readonly) to a new ksh process through the environment, disables passing exported variables' attributes (such as integer or readonly) to a new ksh process through the environment,
causes file descriptors > 2 to be left open when invoking another program, causes file descriptors > 2 to be left open when invoking another program,
makes the \fB<>\fR redirection operator default to standard input, makes the \fB<>\fR redirection operator default to standard input,
@ -8046,14 +8046,48 @@ all interpretations of the given name to be reported.
.SS Invocation. .SS Invocation.
If the shell is invoked by If the shell is invoked by
.IR exec (2), .IR exec (2),
and the first character of argument zero initialization depends on argument zero
.RB ( $0 ) .RB ( $0 )
as follows.
If the first character of
.B $0
is is
.BR \- , .BR \- ,
or the
.B \-l
option is given on the invocation command line,
then the shell is assumed to be a then the shell is assumed to be a
.I login .I login
shell and shell.
commands are read from If the basename of the command path in
.B $0
is
.BR rsh ,
.BR rksh ,
or
.BR krsh ,
then the shell becomes restricted.
If it is
.BR pfsh
or
.BR pfksh ,
then the shell becomes a profile shell (see
.IR pfexec (1)).
If the basename is
.BR sh ,
.BR rsh ,
or
.BR pfsh ,
or the
.B \-o\ posix
option is given on the invocation command line, then
the shell is initialized in full POSIX compliance mode
(see the
.B set
builtin command above for more information).
After this, if the shell was assumed to be a
.I login
shell, commands are read from
.B /etc/profile .B /etc/profile
and then from either and then from either
.B .profile .B .profile
@ -8062,12 +8096,12 @@ in the current directory or
if either file exists. if either file exists.
Next, for interactive shells, commands are read from Next, for interactive shells, commands are read from
the file named by the file named by
performing parameter expansion, command substitution,
and arithmetic substitution on
the value of the environment variable
.SM .SM
.B ENV .B ENV
if the file exists. if the file exists, its name being determined by
performing parameter expansion, command substitution,
and arithmetic substitution on
the value of that environment variable.
If the If the
.B \-s .B \-s
option is not present and option is not present and