mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
Fix various typos, man page issues and improve the documentation (#415)
This commit makes various different improvements to the documentation:
- sh.1: Backported (with changes) mandoc warning fixes from ksh2020
for the ksh93(1) man page: <https://github.com/att/ast/pull/1406>
- Removed unnecessary spaces at the end of lines to fix a few other
mandoc warnings.
- Fixed various typos and capitalization errors in the documentation.
- ANNOUNCE: Document the addition of the ${.sh.pid} variable
(re: 9de65210
).
- libast/man/str*: Update the man pages for the libast str* functions
to improve how accurately each function is described.
- ksh93/README: Update regression test/compatibility notes to include
OpenBSD 7.0, FreeBSD 13.0 and WSL running Ubuntu 20.04.
- Change a few places to store the return value from strlen in a
size_t variable rather than signed int.
- comp/setlocale.c: To avoid confusion of two separate variables named
lang, the function local variable has been renamed to langidx.
This commit is contained in:
parent
d347ec0fc9
commit
ca5803419b
95 changed files with 313 additions and 390 deletions
6
ANNOUNCE
6
ANNOUNCE
|
@ -190,6 +190,12 @@ New shell language features:
|
||||||
command, which never worked and crashed the shell. See the manual for
|
command, which never worked and crashed the shell. See the manual for
|
||||||
details on the new method.
|
details on the new method.
|
||||||
|
|
||||||
|
- A new ${.sh.pid} variable has been added with similar functionality to
|
||||||
|
Bash's $BASHPID variable. It is set to the current shell's PID, unlike
|
||||||
|
$$ (which is set to the main shell's PID). In virtual subshells
|
||||||
|
${.sh.pid} is not changed from its previous value, while in forked
|
||||||
|
subshells ${.sh.pid} is set to the subshell's process ID.
|
||||||
|
|
||||||
New features in built-in commands:
|
New features in built-in commands:
|
||||||
|
|
||||||
- Usage error messages now show the --help/--man self-documentation options.
|
- Usage error messages now show the --help/--man self-documentation options.
|
||||||
|
|
|
@ -528,7 +528,7 @@
|
||||||
02-10-18 probe.win32: update for mingw
|
02-10-18 probe.win32: update for mingw
|
||||||
make.probe: add bash workaround to SHELLMAGIC test
|
make.probe: add bash workaround to SHELLMAGIC test
|
||||||
package.sh: work around yet another Cygwin hassle
|
package.sh: work around yet another Cygwin hassle
|
||||||
02-10-17 iffe.sh: short circuit id check for *[-+/\\]*
|
02-10-17 iffe.sh: short circuit ID check for *[-+/\\]*
|
||||||
02-10-08 regress.sh: unset FIGNORE to avoid rm . errors
|
02-10-08 regress.sh: unset FIGNORE to avoid rm . errors
|
||||||
package.sh: unset FIGNORE to avoid rm . errors
|
package.sh: unset FIGNORE to avoid rm . errors
|
||||||
package.sh: $CC must at least compile and executable hello world
|
package.sh: $CC must at least compile and executable hello world
|
||||||
|
@ -580,7 +580,7 @@
|
||||||
02-03-24 mamake.c: all shell actions wrapped with -c to avoid #! problems
|
02-03-24 mamake.c: all shell actions wrapped with -c to avoid #! problems
|
||||||
02-03-23 package.sh: recover $PACKAGEROOT/bin/package if not in INIT package
|
02-03-23 package.sh: recover $PACKAGEROOT/bin/package if not in INIT package
|
||||||
package.sh: precheck $CC, not `cc'
|
package.sh: precheck $CC, not `cc'
|
||||||
package.sh: fix install to use pax -ps to preserve set-uid/gid
|
package.sh: fix install to use pax -ps to preserve setuid/setgid
|
||||||
package.sh: fix install to use list.installed for existing files only
|
package.sh: fix install to use list.installed for existing files only
|
||||||
02-03-17 package.sh: fix PAX initialization that was sometimes omitted for read
|
02-03-17 package.sh: fix PAX initialization that was sometimes omitted for read
|
||||||
package.sh: fix update delta sync fetch
|
package.sh: fix update delta sync fetch
|
||||||
|
@ -906,7 +906,7 @@
|
||||||
96-10-11 iffe: *.iffe and *.iff for iffe src files
|
96-10-11 iffe: *.iffe and *.iff for iffe src files
|
||||||
hostinfo: tighten sgi.mips CPU type check
|
hostinfo: tighten sgi.mips CPU type check
|
||||||
96-10-01 C.probe: add probe_libdir to catch alpha /usr/shlib
|
96-10-01 C.probe: add probe_libdir to catch alpha /usr/shlib
|
||||||
96-09-17 iffe: fix typ bug that failed for single id types!
|
96-09-17 iffe: fix typ bug that failed for single ID types!
|
||||||
96-08-31 hostinfo: handle recent SGI hinv CPU changes
|
96-08-31 hostinfo: handle recent SGI hinv CPU changes
|
||||||
96-07-17 make sure sizeof(long xxx)>sizeof(xxx) for typ long.xxx
|
96-07-17 make sure sizeof(long xxx)>sizeof(xxx) for typ long.xxx
|
||||||
96-05-09 C.probe: drop multiple / in stdinclude
|
96-05-09 C.probe: drop multiple / in stdinclude
|
||||||
|
|
|
@ -43,7 +43,7 @@ case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in
|
||||||
template commands in the \aunit\a.\brt\b file. The generated test
|
template commands in the \aunit\a.\brt\b file. The generated test
|
||||||
script writes temporary output to '$PREFIX$'\aunit\a.tmp and compares
|
script writes temporary output to '$PREFIX$'\aunit\a.tmp and compares
|
||||||
it to the expected output in '$PREFIX$'\aunit\a.out. Run the test
|
it to the expected output in '$PREFIX$'\aunit\a.out. Run the test
|
||||||
script with the \b--accept\b option to (re)generate the
|
script with the \b--accept\b option to (re)generate
|
||||||
'$PREFIX$'\aunit\a.out.]
|
'$PREFIX$'\aunit\a.out.]
|
||||||
[s:style?The script style:]:[style:='$STYLE$']
|
[s:style?The script style:]:[style:='$STYLE$']
|
||||||
{
|
{
|
||||||
|
|
|
@ -128,7 +128,7 @@ unit [ command [ arg ... ] ]
|
||||||
the files.]
|
the files.]
|
||||||
[+INFO \b\adescription\a?\adescription\a is printed on the
|
[+INFO \b\adescription\a?\adescription\a is printed on the
|
||||||
standard error.]
|
standard error.]
|
||||||
[+INITIALIZE?Called by \bregress\b to initialize a each
|
[+INITIALIZE?Called by \bregress\b to initialize each
|
||||||
\bTEST\b group.]
|
\bTEST\b group.]
|
||||||
[+INPUT \b[ \b-e\b \afilter\a ]] [ \b-n\b ]] \afile\a | - \adata\a ...?The
|
[+INPUT \b[ \b-e\b \afilter\a ]] [ \b-n\b ]] \afile\a | - \adata\a ...?The
|
||||||
standard input is set to either the contents of \afile\a
|
standard input is set to either the contents of \afile\a
|
||||||
|
|
|
@ -36,7 +36,7 @@ The options have the following defaults and meanings:
|
||||||
background job will block until a running background job
|
background job will block until a running background job
|
||||||
completes. (2) SIGCHLD traps are queued so that each
|
completes. (2) SIGCHLD traps are queued so that each
|
||||||
completing background job gets its own trap; $! is set to
|
completing background job gets its own trap; $! is set to
|
||||||
the job pid and $? is set to the job exit status at the
|
the job PID and $? is set to the job exit status at the
|
||||||
beginning of the trap.
|
beginning of the trap.
|
||||||
|
|
||||||
BRACEPAT on Brace expansion. Expands abc{d,e}f to abcdf abcef.
|
BRACEPAT on Brace expansion. Expands abc{d,e}f to abcdf abcef.
|
||||||
|
@ -120,8 +120,8 @@ The options have the following defaults and meanings:
|
||||||
|
|
||||||
PFSH off Compile with support for profile shell. (Solaris; obsolete)
|
PFSH off Compile with support for profile shell. (Solaris; obsolete)
|
||||||
|
|
||||||
P_SUID off If set, all real uids, greater than or equal to this
|
P_SUID off If set, all real UIDs, greater than or equal to this
|
||||||
value will require the -p flag to run suid/sgid scripts.
|
value will require the -p flag to run SUID/SGID scripts.
|
||||||
|
|
||||||
RAWONLY on Turn on if the vi line mode doesn't work right unless
|
RAWONLY on Turn on if the vi line mode doesn't work right unless
|
||||||
you do a set -o viraw.
|
you do a set -o viraw.
|
||||||
|
@ -208,7 +208,7 @@ permission, the SUID_EXEC compile option must be on, and ksh must be installed
|
||||||
in the /bin directory, the /usr/bin directory, the /usr/lbin directory,
|
in the /bin directory, the /usr/bin directory, the /usr/lbin directory,
|
||||||
or the /usr/local/bin directory and the name must end in sh. The program
|
or the /usr/local/bin directory and the name must end in sh. The program
|
||||||
suid_exec must be installed in the /etc directory, must be owned by root,
|
suid_exec must be installed in the /etc directory, must be owned by root,
|
||||||
and must be a suid program. If you must install ksh in some other directory
|
and must be an SUID program. If you must install ksh in some other directory
|
||||||
and want to be able to run setuid/setgid and execute only scripts, then
|
and want to be able to run setuid/setgid and execute only scripts, then
|
||||||
you will have to change the source code file sh/suid_exec.c explicitly.
|
you will have to change the source code file sh/suid_exec.c explicitly.
|
||||||
If you do not have ksh in one of these secure locations, /bin/sh will
|
If you do not have ksh in one of these secure locations, /bin/sh will
|
||||||
|
@ -251,6 +251,7 @@ failures (crashes, and/or important functionality does not work).
|
||||||
* AIX 7.1 on RISC (PowerPC)
|
* AIX 7.1 on RISC (PowerPC)
|
||||||
* DragonFly BSD 5.8 on x86_64
|
* DragonFly BSD 5.8 on x86_64
|
||||||
FreeBSD 12.2 on x86_64
|
FreeBSD 12.2 on x86_64
|
||||||
|
FreeBSD 13.0 on x86_64
|
||||||
FreeBSD 12.2 on arm64 (thanks to hyenias for donating access to a Pi)
|
FreeBSD 12.2 on arm64 (thanks to hyenias for donating access to a Pi)
|
||||||
GNU/Linux: Alpine 3.12.3 (musl C library) on x86_64
|
GNU/Linux: Alpine 3.12.3 (musl C library) on x86_64
|
||||||
GNU/Linux: CentOS 8.2 on x86_64
|
GNU/Linux: CentOS 8.2 on x86_64
|
||||||
|
@ -270,6 +271,7 @@ failures (crashes, and/or important functionality does not work).
|
||||||
* NetBSD 8.1 on x86_64
|
* NetBSD 8.1 on x86_64
|
||||||
* NetBSD 9.2 on x86_64
|
* NetBSD 9.2 on x86_64
|
||||||
* OpenBSD 6.8 on x86_64
|
* OpenBSD 6.8 on x86_64
|
||||||
|
OpenBSD 7.0 on x86_64
|
||||||
** QNX 6.5.0 on i386
|
** QNX 6.5.0 on i386
|
||||||
* Solaris 11.4 (gcc) on x86_64
|
* Solaris 11.4 (gcc) on x86_64
|
||||||
Solaris 11.4 (Solaris Studio 12.5 cc) on x86_64
|
Solaris 11.4 (Solaris Studio 12.5 cc) on x86_64
|
||||||
|
@ -277,6 +279,7 @@ failures (crashes, and/or important functionality does not work).
|
||||||
*** Windows 7 using Cygwin on x86
|
*** Windows 7 using Cygwin on x86
|
||||||
*** Windows 10 using Cygwin on x86_64
|
*** Windows 10 using Cygwin on x86_64
|
||||||
*** Windows 11 using Cygwin on x86_64
|
*** Windows 11 using Cygwin on x86_64
|
||||||
|
* Windows 11 using WSL 2 with Ubuntu 20.04 on x86_64
|
||||||
*** Haiku R1/beta3 on x86_64
|
*** Haiku R1/beta3 on x86_64
|
||||||
|
|
||||||
#### REPORTING BUGS ####
|
#### REPORTING BUGS ####
|
||||||
|
|
|
@ -261,7 +261,7 @@ ____
|
||||||
12-01-21 A bug in which typeset -L and typeset -R did not handle multibyte
|
12-01-21 A bug in which typeset -L and typeset -R did not handle multibyte
|
||||||
characters correctly has been fixed.
|
characters correctly has been fixed.
|
||||||
12-01-20 A bug that could cause the shell to hang waiting for an incorrect
|
12-01-20 A bug that could cause the shell to hang waiting for an incorrect
|
||||||
job pid has been fixed.
|
job PID has been fixed.
|
||||||
12-01-19 A memory leak which occurred for a nested command substitution has been
|
12-01-19 A memory leak which occurred for a nested command substitution has been
|
||||||
fixed.
|
fixed.
|
||||||
12-01-17 A bug in which typeset -u PS1 could enable the uppercase attribute
|
12-01-17 A bug in which typeset -u PS1 could enable the uppercase attribute
|
||||||
|
@ -312,12 +312,12 @@ ____
|
||||||
with more than twenty-five open files has been fixed.
|
with more than twenty-five open files has been fixed.
|
||||||
11-10-06 A bug in the scoping of name references in functions called by other
|
11-10-06 A bug in the scoping of name references in functions called by other
|
||||||
functions has been fixed.
|
functions has been fixed.
|
||||||
11-10-05 A bug in which wait on a pid may return the exit status of an
|
11-10-05 A bug in which wait on a PID may return the exit status of an
|
||||||
earlier background job with that pid instead has been fixed.
|
earlier background job with that PID instead has been fixed.
|
||||||
11-09-22 A bug in which a read timed out with TMOUT did not always restore
|
11-09-22 A bug in which a read timed out with TMOUT did not always restore
|
||||||
the terminal state has been fixed.
|
the terminal state has been fixed.
|
||||||
11-09-21 An optimization that allowed the last command in a script to use
|
11-09-21 An optimization that allowed the last command in a script to use
|
||||||
the same process id as the script has been eliminated.
|
the same process ID as the script has been eliminated.
|
||||||
11-09-21 Added letoctal option that enables the let command to recognize
|
11-09-21 Added letoctal option that enables the let command to recognize
|
||||||
octal constants starting with 0.
|
octal constants starting with 0.
|
||||||
11-09-20 A bug in which ${var.} could cause a core dump has been fixed.
|
11-09-20 A bug in which ${var.} could cause a core dump has been fixed.
|
||||||
|
@ -394,7 +394,7 @@ ____
|
||||||
been fixed.
|
been fixed.
|
||||||
11-05-02 A bug in which the shell discards saved exit status of a job if it is
|
11-05-02 A bug in which the shell discards saved exit status of a job if it is
|
||||||
followed by a subshell execution has been fixed.
|
followed by a subshell execution has been fixed.
|
||||||
11-04-28 The shell now checks for numerical overflows with process ids.
|
11-04-28 The shell now checks for numerical overflows with process IDs.
|
||||||
11-04-28 Another scoping bug with compound variables defined by name references
|
11-04-28 Another scoping bug with compound variables defined by name references
|
||||||
inside a function has been fixed.
|
inside a function has been fixed.
|
||||||
11-04-28 A bug which caused a core dump on 32 bit systems with the basic.sh
|
11-04-28 A bug which caused a core dump on 32 bit systems with the basic.sh
|
||||||
|
@ -684,7 +684,7 @@ ____
|
||||||
10-08-09 +Modified the expansion of message strings, $"...", so that they
|
10-08-09 +Modified the expansion of message strings, $"...", so that they
|
||||||
are expanded each time they are referenced rather than expanding
|
are expanded each time they are referenced rather than expanding
|
||||||
them when the script is compiled or read in.
|
them when the script is compiled or read in.
|
||||||
10-08-06 +The process id for jobs in job pools is now of the form poolname.n
|
10-08-06 +The process ID for jobs in job pools is now of the form poolname.n
|
||||||
where n is the jobid in that pool. Commands that accept job names
|
where n is the jobid in that pool. Commands that accept job names
|
||||||
or numbers now understand names in this format.
|
or numbers now understand names in this format.
|
||||||
10-08-05 A bug in which an assignment from within an arithmetic expression
|
10-08-05 A bug in which an assignment from within an arithmetic expression
|
||||||
|
@ -973,7 +973,7 @@ ____
|
||||||
decimal_point=','.
|
decimal_point=','.
|
||||||
09-11-02 A bug where "return" in .profile did not restore the shell state
|
09-11-02 A bug where "return" in .profile did not restore the shell state
|
||||||
has been fixed.
|
has been fixed.
|
||||||
09-10-31 A bug that corrupted saved exit status when pids wrapped around has
|
09-10-31 A bug that corrupted saved exit status when PIDs wrapped around has
|
||||||
been fixed.
|
been fixed.
|
||||||
09-10-26 A bug in { LANG LC_ALL LC_category } ordering has been fixed in -last.
|
09-10-26 A bug in { LANG LC_ALL LC_category } ordering has been fixed in -last.
|
||||||
09-10-16 A bug where notification to libast that the environment has changed
|
09-10-16 A bug where notification to libast that the environment has changed
|
||||||
|
@ -1099,13 +1099,13 @@ ____
|
||||||
09-03-24 +ksh now only uses the value of the _ variable on startup if it can
|
09-03-24 +ksh now only uses the value of the _ variable on startup if it can
|
||||||
verify that it was set by the invoking process rather than being
|
verify that it was set by the invoking process rather than being
|
||||||
inherited by some other ancestor.
|
inherited by some other ancestor.
|
||||||
09-03-24 +When ksh is invoked without -p and ruid!=euid, and the shell is
|
09-03-24 +When ksh is invoked without -p and RUID != EUID, and the shell is
|
||||||
compiled without SHOPT_P_UID or ruid<SHOPT_P_UID, the shell now
|
compiled without SHOPT_P_UID or RUID < SHOPT_P_UID, the shell now
|
||||||
enables the -p option. The previous version instead set the
|
enables the -p option. The previous version instead set the
|
||||||
euid to the ruid as it does for set +p.
|
EUID to the RUID as it does for set +p.
|
||||||
09-03-24 +When SHOPT_P_UID is defined at compile time and the shell is started
|
09-03-24 +When SHOPT_P_UID is defined at compile time and the shell is started
|
||||||
without -p and ruid!=euid and ruid>=SHOPT_P_UID then euid is set
|
without -p and RUID != EUID and RUID >= SHOPT_P_UID then EUID is set
|
||||||
to ruid. A bug that did the wrong test (ruid<SHOPT_P_UID) was fixed.
|
to RUID. A bug that did the wrong test (RUID < SHOPT_P_UID) was fixed.
|
||||||
09-03-17 +The sleep(1) builtin now accept and ISO 8601 PnYnMnDTnHnMnS
|
09-03-17 +The sleep(1) builtin now accept and ISO 8601 PnYnMnDTnHnMnS
|
||||||
duration or date(1) compatible date/time operand.
|
duration or date(1) compatible date/time operand.
|
||||||
09-03-10 If a variable that was left or right justified or zero-filled was
|
09-03-10 If a variable that was left or right justified or zero-filled was
|
||||||
|
@ -1194,7 +1194,7 @@ ____
|
||||||
of concurrent & jobs to n; the n+1 & job will block until a
|
of concurrent & jobs to n; the n+1 & job will block until a
|
||||||
running background job completes. (2) SIGCHLD traps are queued
|
running background job completes. (2) SIGCHLD traps are queued
|
||||||
so that each completing background job gets its own trap; $! is
|
so that each completing background job gets its own trap; $! is
|
||||||
set to the job pid and $? is set to the job exit status at the
|
set to the job PID and $? is set to the job exit status at the
|
||||||
beginning of the trap. (3) sleep -s added to sleep until the time
|
beginning of the trap. (3) sleep -s added to sleep until the time
|
||||||
expires or until a signal is delivered.
|
expires or until a signal is delivered.
|
||||||
08-12-04 The sign of floating point zero is preserved across arithmetic
|
08-12-04 The sign of floating point zero is preserved across arithmetic
|
||||||
|
@ -1214,8 +1214,8 @@ ____
|
||||||
set for an instance could appear twice when displaying the variable
|
set for an instance could appear twice when displaying the variable
|
||||||
has been fixed.
|
has been fixed.
|
||||||
08-11-11 A bug in which running a simple command & inside a function would
|
08-11-11 A bug in which running a simple command & inside a function would
|
||||||
not return the correct process id has been fixed.
|
not return the correct process ID has been fixed.
|
||||||
08-11-10 A bug in which the exit status of a command could be lost if the pid
|
08-11-10 A bug in which the exit status of a command could be lost if the PID
|
||||||
was that of the most recent command substitution that had completed
|
was that of the most recent command substitution that had completed
|
||||||
has been fixed.
|
has been fixed.
|
||||||
08-11-10 The maximum depth for subshells has been increased from 256 to 65536.
|
08-11-10 The maximum depth for subshells has been increased from 256 to 65536.
|
||||||
|
@ -1369,7 +1369,7 @@ ____
|
||||||
08-06-09 A bug in which the return value for an assignment command containing
|
08-06-09 A bug in which the return value for an assignment command containing
|
||||||
a command substitution with that failed was zero when the assignment
|
a command substitution with that failed was zero when the assignment
|
||||||
contained redirections has been fixed.
|
contained redirections has been fixed.
|
||||||
08-06-09 A bug in the quoting of $ inside a ERE pattern ~(E)(pattern)
|
08-06-09 A bug in the quoting of $ inside an ERE pattern ~(E)(pattern)
|
||||||
has been fixed.
|
has been fixed.
|
||||||
08-06-06 A bug when processing `` command substitution with the character
|
08-06-06 A bug when processing `` command substitution with the character
|
||||||
sequence \$' has been fixed.
|
sequence \$' has been fixed.
|
||||||
|
@ -1710,7 +1710,7 @@ ____
|
||||||
06-10-26 +The printf modifier # when used with d produces units in thousands
|
06-10-26 +The printf modifier # when used with d produces units in thousands
|
||||||
with a single letter suffix added. The modifier # when used with
|
with a single letter suffix added. The modifier # when used with
|
||||||
the i specification provides units of 1024 with a two letter suffix.
|
the i specification provides units of 1024 with a two letter suffix.
|
||||||
06-10-24 The value of $! is now set to the process id of a job put
|
06-10-24 The value of $! is now set to the process ID of a job put
|
||||||
into the background with the bg command as required by POSIX.
|
into the background with the bg command as required by POSIX.
|
||||||
06-10-23 A bug in which the value of $! was affected by a background
|
06-10-23 A bug in which the value of $! was affected by a background
|
||||||
job started from a subshell has been fixed.
|
job started from a subshell has been fixed.
|
||||||
|
@ -1735,7 +1735,7 @@ ____
|
||||||
is only needed when using the ([subscript]=value ...) form.
|
is only needed when using the ([subscript]=value ...) form.
|
||||||
06-09-06 +The showme option was added. Each simple command not beginning
|
06-09-06 +The showme option was added. Each simple command not beginning
|
||||||
with a redirection and not occurring with in the while, until, if,
|
with a redirection and not occurring with in the while, until, if,
|
||||||
select condition can be preceded by a semi-colon which will
|
select condition can be preceded by a semicolon which will
|
||||||
be ignored when showme is off. When showme is on, any command
|
be ignored when showme is off. When showme is on, any command
|
||||||
preceded by a colon will be traced but not executed.
|
preceded by a colon will be traced but not executed.
|
||||||
06-08-16 +As a new feature, a leading ~(N) on a pattern has no effect
|
06-08-16 +As a new feature, a leading ~(N) on a pattern has no effect
|
||||||
|
@ -2487,7 +2487,7 @@ ____
|
||||||
were previously processed in undefined ways.
|
were previously processed in undefined ways.
|
||||||
01-05-09 A bug in which the output of select was not flushed before the
|
01-05-09 A bug in which the output of select was not flushed before the
|
||||||
read when input did not come from the terminal has been fixed.
|
read when input did not come from the terminal has been fixed.
|
||||||
01-05-08 A bug in which job ids would not be freed for interactive shells
|
01-05-08 A bug in which job IDs would not be freed for interactive shells
|
||||||
when subshells ran built-ins in the background has been fixed.
|
when subshells ran built-ins in the background has been fixed.
|
||||||
01-05-08 +The FPATH variable now requires an explicit . to cause the
|
01-05-08 +The FPATH variable now requires an explicit . to cause the
|
||||||
current directory to be treated as a function directory.
|
current directory to be treated as a function directory.
|
||||||
|
|
|
@ -32,13 +32,13 @@ SHOPT NOECHOE=0 # turn off 'echo -e' when SHOPT_ECHOPRINT is disabled
|
||||||
SHOPT OLDTERMIO= # support both TCGETA and TCGETS
|
SHOPT OLDTERMIO= # support both TCGETA and TCGETS
|
||||||
SHOPT OPTIMIZE=1 # optimize loop invariants
|
SHOPT OPTIMIZE=1 # optimize loop invariants
|
||||||
SHOPT PFSH=0 # Solaris exec_attr(4) profile execution (obsolete)
|
SHOPT PFSH=0 # Solaris exec_attr(4) profile execution (obsolete)
|
||||||
SHOPT P_SUID= # real uids that require -p for set[ug]id (do not set to 0 to turn off)
|
SHOPT P_SUID= # real UIDs that require -p for set[ug]id (do not set to 0 to turn off)
|
||||||
SHOPT RAWONLY=1 # make viraw the only vi mode
|
SHOPT RAWONLY=1 # make viraw the only vi mode
|
||||||
SHOPT REGRESS= # enable __regress__ builtin and instrumented intercepts for testing
|
SHOPT REGRESS= # enable __regress__ builtin and instrumented intercepts for testing
|
||||||
SHOPT REMOTE= # enable --rc if running as a remote shell
|
SHOPT REMOTE= # enable --rc if running as a remote shell
|
||||||
SHOPT SPAWN= # use spawnveg for fork/exec
|
SHOPT SPAWN= # use spawnveg for fork/exec
|
||||||
SHOPT STATS=1 # add .sh.stats variable
|
SHOPT STATS=1 # add .sh.stats variable
|
||||||
SHOPT SUID_EXEC=1 # allow (safe) suid/sgid shell scripts
|
SHOPT SUID_EXEC=1 # allow (safe) SUID/SGID shell scripts
|
||||||
SHOPT SYSRC= # attempt . /etc/ksh.kshrc if interactive
|
SHOPT SYSRC= # attempt . /etc/ksh.kshrc if interactive
|
||||||
SHOPT TEST_L= # add 'test -l' as an alias for 'test -L'
|
SHOPT TEST_L= # add 'test -l' as an alias for 'test -L'
|
||||||
SHOPT TIMEOUT= # number of seconds for shell timeout
|
SHOPT TIMEOUT= # number of seconds for shell timeout
|
||||||
|
|
|
@ -66,31 +66,31 @@ static const char usage[] =
|
||||||
"the specific intercept for \aoption\a, and \ainfo\a is \aoption\a "
|
"the specific intercept for \aoption\a, and \ainfo\a is \aoption\a "
|
||||||
"specific information. Unless noted otherwise, one regression test trace "
|
"specific information. Unless noted otherwise, one regression test trace "
|
||||||
"line is produced each time an enabled intercept is called.]"
|
"line is produced each time an enabled intercept is called.]"
|
||||||
"[101:egid?The intercept effective gid is set to \aoriginal-egid\a. The "
|
"[101:egid?The intercept effective GID is set to \aoriginal-egid\a. The "
|
||||||
"effective gid of the underlying system process is not affected. The "
|
"effective GID of the underlying system process is not affected. The "
|
||||||
"trace line info is either \begid==rgid\b or \begid!=rgid\b. The "
|
"trace line info is either \begid==rgid\b or \begid!=rgid\b. The "
|
||||||
"intercepts are:]#?[original-egid:=1]"
|
"intercepts are:]#?[original-egid:=1]"
|
||||||
"{"
|
"{"
|
||||||
"[+getegid()?The intercept effective gid is returned. The "
|
"[+getegid()?The intercept effective GID is returned. The "
|
||||||
"\bsetgid\b() intercept may change this between the real gid and "
|
"\bsetgid\b() intercept may change this between the real GID and "
|
||||||
"\aoriginal-egid\a.]"
|
"\aoriginal-egid\a.]"
|
||||||
"[+setgid(gid)?Sets the intercept effective gid to \agid\a. "
|
"[+setgid(gid)?Sets the intercept effective GID to \agid\a. "
|
||||||
"Fails if \agid\a is neither the real gid nor "
|
"Fails if \agid\a is neither the real GID nor "
|
||||||
"\aoriginal-egid\a.]"
|
"\aoriginal-egid\a.]"
|
||||||
"}"
|
"}"
|
||||||
"[102:euid?The intercept effective uid is set to \aoriginal-euid\a. The "
|
"[102:euid?The intercept effective UID is set to \aoriginal-euid\a. The "
|
||||||
"effective uid of the underlying system process is not affected. The "
|
"effective UID of the underlying system process is not affected. The "
|
||||||
"trace line info is either \beuid==ruid\b or \beuid!=ruid\b. The "
|
"trace line info is either \beuid==ruid\b or \beuid!=ruid\b. The "
|
||||||
"intercepts are:]#?[original-euid:=1]"
|
"intercepts are:]#?[original-euid:=1]"
|
||||||
"{"
|
"{"
|
||||||
"[+geteuid()?The intercept effective uid is returned. The "
|
"[+geteuid()?The intercept effective UID is returned. The "
|
||||||
"\bsetuid\b() intercept may change this between the real uid and "
|
"\bsetuid\b() intercept may change this between the real UID and "
|
||||||
"\aoriginal-euid\a.]"
|
"\aoriginal-euid\a.]"
|
||||||
"[+setuid(uid)?Sets the intercept effective uid to \auid\a. "
|
"[+setuid(uid)?Sets the intercept effective UID to \auid\a. "
|
||||||
"Fails if \auid\a is neither the real uid nor "
|
"Fails if \auid\a is neither the real UID nor "
|
||||||
"\aoriginal-euid\a.]"
|
"\aoriginal-euid\a.]"
|
||||||
"}"
|
"}"
|
||||||
"[103:p_suid?Specifies a value for SHOPT_P_SUID. Effective uids greater "
|
"[103:p_suid?Specifies a value for SHOPT_P_SUID. Effective UIDs greater "
|
||||||
"than the non-privileged-uid disable the privileged mode. The intercepts "
|
"than the non-privileged-uid disable the privileged mode. The intercepts "
|
||||||
"are:]#?[non-privileged-uid:=1]"
|
"are:]#?[non-privileged-uid:=1]"
|
||||||
"{"
|
"{"
|
||||||
|
@ -146,7 +146,7 @@ void sh_regress(unsigned int index, const char* intercept, const char* info, uns
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* egid intercepts
|
* EGID intercepts
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static gid_t intercept_sgid = 0;
|
static gid_t intercept_sgid = 0;
|
||||||
|
@ -189,7 +189,7 @@ int setgid(gid_t gid)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* euid intercepts
|
* EUID intercepts
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static uid_t intercept_suid = 0;
|
static uid_t intercept_suid = 0;
|
||||||
|
|
|
@ -595,7 +595,7 @@ int test_inode(const char *file1,const char *file2)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This version of access checks against effective uid/gid
|
* This version of access checks against the effective UID/GID
|
||||||
* The static buffer statb is shared with test_mode.
|
* The static buffer statb is shared with test_mode.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -612,15 +612,15 @@ int sh_access(register const char *name, register int mode)
|
||||||
if(sh.userid==sh.euserid && sh.groupid==sh.egroupid)
|
if(sh.userid==sh.euserid && sh.groupid==sh.egroupid)
|
||||||
return(access(name,mode));
|
return(access(name,mode));
|
||||||
#ifdef _lib_setreuid
|
#ifdef _lib_setreuid
|
||||||
/* swap the real uid to effective, check access then restore */
|
/* swap the real UID to effective, check access then restore */
|
||||||
/* first swap real and effective gid, if different */
|
/* first swap real and effective GID, if different */
|
||||||
if(sh.groupid==sh.euserid || setregid(sh.egroupid,sh.groupid)==0)
|
if(sh.groupid==sh.euserid || setregid(sh.egroupid,sh.groupid)==0)
|
||||||
{
|
{
|
||||||
/* next swap real and effective uid, if needed */
|
/* next swap real and effective UID, if needed */
|
||||||
if(sh.userid==sh.euserid || setreuid(sh.euserid,sh.userid)==0)
|
if(sh.userid==sh.euserid || setreuid(sh.euserid,sh.userid)==0)
|
||||||
{
|
{
|
||||||
mode = access(name,mode);
|
mode = access(name,mode);
|
||||||
/* restore ids */
|
/* restore IDs */
|
||||||
if(sh.userid!=sh.euserid)
|
if(sh.userid!=sh.euserid)
|
||||||
setreuid(sh.userid,sh.euserid);
|
setreuid(sh.userid,sh.euserid);
|
||||||
if(sh.groupid!=sh.egroupid)
|
if(sh.groupid!=sh.egroupid)
|
||||||
|
|
|
@ -1556,7 +1556,7 @@ static void print_attribute(register Namval_t *np,void *data)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* print the nodes in tree <root> which have attributes <flag> set
|
* print the nodes in tree <root> which have attributes <flag> set
|
||||||
* of <option> is non-zero, no subscript or value is printed.
|
* if <option> is non-zero, no subscript or value is printed
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void print_scan(Sfio_t *file, int flag, Dt_t *root, int option,struct tdata *tp)
|
static void print_scan(Sfio_t *file, int flag, Dt_t *root, int option,struct tdata *tp)
|
||||||
|
@ -1566,7 +1566,7 @@ static void print_scan(Sfio_t *file, int flag, Dt_t *root, int option,struct tda
|
||||||
register int namec;
|
register int namec;
|
||||||
Namval_t *onp = 0;
|
Namval_t *onp = 0;
|
||||||
char *name=0;
|
char *name=0;
|
||||||
int len;
|
size_t len;
|
||||||
sh.last_table=0;
|
sh.last_table=0;
|
||||||
flag &= ~NV_ASSIGN;
|
flag &= ~NV_ASSIGN;
|
||||||
tp->scanmask = flag&~NV_NOSCOPE;
|
tp->scanmask = flag&~NV_NOSCOPE;
|
||||||
|
|
|
@ -157,8 +157,8 @@ const struct shtable3 shtab_builtins[] =
|
||||||
};
|
};
|
||||||
|
|
||||||
#define _JOB_ "[+?Each \ajob\a can be specified as one of the following:]{" \
|
#define _JOB_ "[+?Each \ajob\a can be specified as one of the following:]{" \
|
||||||
"[+\anumber\a?\anumber\a refers to a process id.]" \
|
"[+\anumber\a?\anumber\a refers to a process ID.]" \
|
||||||
"[+-\anumber\a?\anumber\a refers to a process group id.]" \
|
"[+-\anumber\a?\anumber\a refers to a process group ID.]" \
|
||||||
"[+%\anumber\a?\anumber\a refer to a job number.]" \
|
"[+%\anumber\a?\anumber\a refer to a job number.]" \
|
||||||
"[+%\astring\a?Refers to a job whose name begins with \astring\a.]" \
|
"[+%\astring\a?Refers to a job whose name begins with \astring\a.]" \
|
||||||
"[+%??\astring\a?Refers to a job whose name contains \astring\a.]" \
|
"[+%??\astring\a?Refers to a job whose name contains \astring\a.]" \
|
||||||
|
@ -272,12 +272,12 @@ const char sh_set[] =
|
||||||
"to \b-o posix\b and \b--noposix\b is equivalent to \b+o posix\b. "
|
"to \b-o posix\b and \b--noposix\b is equivalent to \b+o posix\b. "
|
||||||
"However, option names with a \bno\b prefix "
|
"However, option names with a \bno\b prefix "
|
||||||
"are turned on by omitting \bno\b.]"
|
"are turned on by omitting \bno\b.]"
|
||||||
"[p?Privileged mode. Disabling \b-p\b sets the effective user id to the "
|
"[p?Privileged mode. Disabling \b-p\b sets the effective user ID to the "
|
||||||
"real user id, and the effective group id to the real group id. "
|
"real user ID, and the effective group ID to the real group ID. "
|
||||||
"Enabling \b-p\b restores the effective user and group ids to their "
|
"Enabling \b-p\b restores the effective user and group IDs to their "
|
||||||
"values when the shell was invoked. The \b-p\b option is on "
|
"values when the shell was invoked. The \b-p\b option is on "
|
||||||
"whenever the real and effective user id is not equal or the "
|
"whenever the real and effective user ID is not equal or the "
|
||||||
"real and effective group id is not equal. User profiles are "
|
"real and effective group ID is not equal. User profiles are "
|
||||||
"not processed when \b-p\b is enabled.]"
|
"not processed when \b-p\b is enabled.]"
|
||||||
"[r?restricted. Enables restricted shell. This option cannot be unset once "
|
"[r?restricted. Enables restricted shell. This option cannot be unset once "
|
||||||
"enabled.]"
|
"enabled.]"
|
||||||
|
@ -923,11 +923,11 @@ const char sh_optjobs[] =
|
||||||
"shell removes the jobs from the list of known jobs in "
|
"shell removes the jobs from the list of known jobs in "
|
||||||
"the current shell environment.]"
|
"the current shell environment.]"
|
||||||
_JOB_
|
_JOB_
|
||||||
"[l?\bjobs\b displays process ids after the job number in addition "
|
"[l?\bjobs\b displays process IDs after the job number in addition "
|
||||||
"to the usual information]"
|
"to the usual information]"
|
||||||
"[n?Only the jobs whose status has changed since the last prompt "
|
"[n?Only the jobs whose status has changed since the last prompt "
|
||||||
"is displayed.]"
|
"is displayed.]"
|
||||||
"[p?The process group leader ids for the specified jobs are displayed.]"
|
"[p?The process group leader IDs for the specified jobs are displayed.]"
|
||||||
"\n"
|
"\n"
|
||||||
"\n[job ...]\n"
|
"\n[job ...]\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
@ -2035,7 +2035,7 @@ const char sh_optwait[] =
|
||||||
"\ajob\a operands are specified, \bwait\b waits until all of them "
|
"\ajob\a operands are specified, \bwait\b waits until all of them "
|
||||||
"have completed.]"
|
"have completed.]"
|
||||||
_JOB_
|
_JOB_
|
||||||
"[+?If one or more \ajob\a operands is a process id or process group id "
|
"[+?If one or more \ajob\a operands is a process ID or process group ID "
|
||||||
"not known by the current shell environment, \bwait\b treats each "
|
"not known by the current shell environment, \bwait\b treats each "
|
||||||
"of them as if it were a process that exited with status 127.]"
|
"of them as if it were a process that exited with status 127.]"
|
||||||
"\n"
|
"\n"
|
||||||
|
@ -2047,7 +2047,7 @@ _JOB_
|
||||||
"Otherwise, it will be one of the following:]{"
|
"Otherwise, it will be one of the following:]{"
|
||||||
"[+0?\bwait\b utility was invoked with no operands and all "
|
"[+0?\bwait\b utility was invoked with no operands and all "
|
||||||
"processes known by the invoking process have terminated.]"
|
"processes known by the invoking process have terminated.]"
|
||||||
"[+127?\ajob\a is a process id or process group id that is unknown "
|
"[+127?\ajob\a is a process ID or process group ID that is unknown "
|
||||||
"to the current shell environment.]"
|
"to the current shell environment.]"
|
||||||
"}"
|
"}"
|
||||||
|
|
||||||
|
|
|
@ -163,8 +163,8 @@ const char e_autoloadfrom[] = " (autoload from %s)";
|
||||||
const char e_jobsrunning[] = "You have running jobs";
|
const char e_jobsrunning[] = "You have running jobs";
|
||||||
const char e_no_job[] = "no such job";
|
const char e_no_job[] = "no such job";
|
||||||
const char e_no_proc[] = "no such process";
|
const char e_no_proc[] = "no such process";
|
||||||
const char e_badpid[] = "%s: invalid process id";
|
const char e_badpid[] = "%s: invalid process ID";
|
||||||
const char e_jobusage[] = "%s: Arguments must be %%job or process ids";
|
const char e_jobusage[] = "%s: Arguments must be %%job or process IDs";
|
||||||
#endif /* JOBS */
|
#endif /* JOBS */
|
||||||
const char e_coredump[] = "(coredump)";
|
const char e_coredump[] = "(coredump)";
|
||||||
const char e_alphanum[] = "[_[:alpha:]]*([_[:alnum:]])";
|
const char e_alphanum[] = "[_[:alpha:]]*([_[:alnum:]])";
|
||||||
|
|
|
@ -159,7 +159,7 @@ characters in the middle of the line.
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
FIRST, /* First time thru for logical line, prompt on screen */
|
FIRST, /* First time through for logical line, prompt on screen */
|
||||||
REFRESH, /* Redraw entire screen */
|
REFRESH, /* Redraw entire screen */
|
||||||
APPEND, /* Append char before cursor to screen */
|
APPEND, /* Append char before cursor to screen */
|
||||||
UPDATE, /* Update the screen as need be */
|
UPDATE, /* Update the screen as need be */
|
||||||
|
@ -1509,8 +1509,8 @@ static void draw(register Emacs_t *ep,Draw_t option)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
Is the range of screen[0] thru screen[w_size] up-to-date
|
Is the range of screen[0] through screen[w_size] up-to-date
|
||||||
with nscreen[offset] thru nscreen[offset+w_size] ?
|
with nscreen[offset] through nscreen[offset+w_size] ?
|
||||||
If not, update as need be.
|
If not, update as need be.
|
||||||
***********************/
|
***********************/
|
||||||
|
|
||||||
|
|
|
@ -1157,7 +1157,7 @@ static void del_line(register Vi_t *vp, int mode)
|
||||||
|
|
||||||
/*{ DELMOTION( motion, mode )
|
/*{ DELMOTION( motion, mode )
|
||||||
*
|
*
|
||||||
* Delete thru motion.
|
* Delete through motion.
|
||||||
*
|
*
|
||||||
* mode = 'd', save deleted characters, delete
|
* mode = 'd', save deleted characters, delete
|
||||||
* = 'c', do not save characters, change
|
* = 'c', do not save characters, change
|
||||||
|
@ -2699,7 +2699,7 @@ deleol:
|
||||||
c = '$';
|
c = '$';
|
||||||
goto yankeol;
|
goto yankeol;
|
||||||
|
|
||||||
case 'y': /** yank thru motion **/
|
case 'y': /** yank through motion **/
|
||||||
if( mode )
|
if( mode )
|
||||||
c = vp->lastmotion;
|
c = vp->lastmotion;
|
||||||
else
|
else
|
||||||
|
|
|
@ -91,8 +91,8 @@ extern char* sh_setenviron(const char*);
|
||||||
#define SH_CMDLIB_DIR "/opt/ast/bin"
|
#define SH_CMDLIB_DIR "/opt/ast/bin"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SH_ID "ksh" /* ksh id */
|
#define SH_ID "ksh" /* ksh ID */
|
||||||
#define SH_STD "sh" /* standard sh id */
|
#define SH_STD "sh" /* standard sh ID */
|
||||||
|
|
||||||
/* defines for sh_type() */
|
/* defines for sh_type() */
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ struct process
|
||||||
struct process *p_nxtjob; /* next job structure */
|
struct process *p_nxtjob; /* next job structure */
|
||||||
struct process *p_nxtproc; /* next process in current job */
|
struct process *p_nxtproc; /* next process in current job */
|
||||||
int *p_exitval; /* place to store the exitval */
|
int *p_exitval; /* place to store the exitval */
|
||||||
pid_t p_pid; /* process id */
|
pid_t p_pid; /* process ID */
|
||||||
pid_t p_pgrp; /* process group */
|
pid_t p_pgrp; /* process group */
|
||||||
pid_t p_fgrp; /* process group when stopped */
|
pid_t p_fgrp; /* process group when stopped */
|
||||||
short p_job; /* job number of process */
|
short p_job; /* job number of process */
|
||||||
|
@ -78,11 +78,11 @@ struct jobs
|
||||||
{
|
{
|
||||||
struct process *pwlist; /* head of process list */
|
struct process *pwlist; /* head of process list */
|
||||||
int *exitval; /* pipe exit values */
|
int *exitval; /* pipe exit values */
|
||||||
pid_t curpgid; /* current process gid id */
|
pid_t curpgid; /* current process GID */
|
||||||
pid_t parent; /* set by fork() */
|
pid_t parent; /* set by fork() */
|
||||||
pid_t mypid; /* process id of shell */
|
pid_t mypid; /* process ID of shell */
|
||||||
pid_t mypgid; /* process group id of shell */
|
pid_t mypgid; /* process group ID of shell */
|
||||||
pid_t mytgid; /* terminal group id of shell */
|
pid_t mytgid; /* terminal group ID of shell */
|
||||||
int curjobid;
|
int curjobid;
|
||||||
unsigned int in_critical; /* >0 => in critical region */
|
unsigned int in_critical; /* >0 => in critical region */
|
||||||
int savesig; /* active signal */
|
int savesig; /* active signal */
|
||||||
|
|
|
@ -99,7 +99,7 @@ typedef struct _shlex_
|
||||||
unsigned long unknown; /* <unknown> entity number */
|
unsigned long unknown; /* <unknown> entity number */
|
||||||
off_t kiabegin; /* offset of first entry */
|
off_t kiabegin; /* offset of first entry */
|
||||||
char *scriptname; /* name of script file */
|
char *scriptname; /* name of script file */
|
||||||
Dt_t *entity_tree; /* for entity ids */
|
Dt_t *entity_tree; /* for entity IDs */
|
||||||
#endif /* SHOPT_KIA */
|
#endif /* SHOPT_KIA */
|
||||||
/* The following two struct members are considered private to lex.c */
|
/* The following two struct members are considered private to lex.c */
|
||||||
struct _shlex_pvt_lexdata_ lexd;
|
struct _shlex_pvt_lexdata_ lexd;
|
||||||
|
@ -167,7 +167,7 @@ typedef struct _shlex_
|
||||||
#define SH_ASSIGN 020
|
#define SH_ASSIGN 020
|
||||||
#define SH_FUNDEF 040
|
#define SH_FUNDEF 040
|
||||||
#define SH_ARRAY 0100
|
#define SH_ARRAY 0100
|
||||||
#define SH_SEMI 0200 /* semi-colon after NL ok */
|
#define SH_SEMI 0200 /* semicolon after NL ok */
|
||||||
|
|
||||||
#define SH_COMPASSIGN 010 /* allow compound assignments only */
|
#define SH_COMPASSIGN 010 /* allow compound assignments only */
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ UNIT ksh-regress
|
||||||
|
|
||||||
EXPORT HOME=. ENV=.env.sh LC_ALL=C HISTFILE=
|
EXPORT HOME=. ENV=.env.sh LC_ALL=C HISTFILE=
|
||||||
|
|
||||||
TEST mode suid/sgid combinations
|
TEST mode SUID/SGID combinations
|
||||||
|
|
||||||
# these tests are the product { all modes combinations } X { tests }
|
# these tests are the product { all modes combinations } X { tests }
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ UNIT ksh-regress
|
||||||
|
|
||||||
EXPORT HOME=. ENV=.env.sh LC_ALL=C HISTFILE=''
|
EXPORT HOME=. ENV=.env.sh LC_ALL=C HISTFILE=''
|
||||||
|
|
||||||
TEST 01 'mode suid/sgid combinations'
|
TEST 01 'mode SUID/SGID combinations'
|
||||||
|
|
||||||
EXEC --regress=etc=. --regress=source
|
EXEC --regress=etc=. --regress=source
|
||||||
INPUT - 'set --state'
|
INPUT - 'set --state'
|
||||||
|
|
|
@ -151,7 +151,6 @@ Only the top level scope is used.
|
||||||
Just return \f3NULL\fP when an error occurs.
|
Just return \f3NULL\fP when an error occurs.
|
||||||
By default an error message is displayed and the current command
|
By default an error message is displayed and the current command
|
||||||
is aborted.
|
is aborted.
|
||||||
.IP
|
|
||||||
.PP
|
.PP
|
||||||
If a name-value pair by this name does not already exist, it is
|
If a name-value pair by this name does not already exist, it is
|
||||||
created unless \fIflags\fP contains the \f3NV_NOADD\fP flag.
|
created unless \fIflags\fP contains the \f3NV_NOADD\fP flag.
|
||||||
|
@ -212,7 +211,7 @@ The \f3nv_setsize()\fP function returns the size of the field for
|
||||||
justified variables, the arithmetic base for integer variables,
|
justified variables, the arithmetic base for integer variables,
|
||||||
and the precision or number of places after the decimal point
|
and the precision or number of places after the decimal point
|
||||||
for floating point variables. If \fIsize\fP is greater than or
|
for floating point variables. If \fIsize\fP is greater than or
|
||||||
equal to zero, the current size is changed to this value.
|
equal to zero, the current size is changed to this value.
|
||||||
The \f3nv_size()\fP function is equivalent to \f3nv_setsize()\fP
|
The \f3nv_size()\fP function is equivalent to \f3nv_setsize()\fP
|
||||||
with the second argument negative.
|
with the second argument negative.
|
||||||
.PP
|
.PP
|
||||||
|
@ -349,7 +348,7 @@ variable discipline if the node \fInp\fP is a compound variable
|
||||||
or \f3NULL\fP otherwise.
|
or \f3NULL\fP otherwise.
|
||||||
.PP
|
.PP
|
||||||
The \f3nv_isarray()\fP function returns a non-zero value if the specified
|
The \f3nv_isarray()\fP function returns a non-zero value if the specified
|
||||||
name-value pair is an array.
|
name-value pair is an array.
|
||||||
.PP
|
.PP
|
||||||
The \f3nv_scan()\fP function is used to walk through
|
The \f3nv_scan()\fP function is used to walk through
|
||||||
all name-value pairs in the dictionary given by \fIdict\fP.
|
all name-value pairs in the dictionary given by \fIdict\fP.
|
||||||
|
@ -357,11 +356,11 @@ If the \f3flags\fP variable contains the \f3NV_NOSCOPE\fP
|
||||||
flag, then only the top scope will be examined.
|
flag, then only the top scope will be examined.
|
||||||
The remaining flags will be used in conjunction with \fImask\fP
|
The remaining flags will be used in conjunction with \fImask\fP
|
||||||
to further restrict the walk.
|
to further restrict the walk.
|
||||||
If \fImask\fP is non-zero, only the nodes for which
|
If \fImask\fP is non-zero, only the nodes for which
|
||||||
\f3nv_isattr(\fP\fInode\fP\f3,\fP\fImask\fP\f3)\fP
|
\f3nv_isattr(\fP\fInode\fP\f3,\fP\fImask\fP\f3)\fP
|
||||||
is equal to \fIflags\fP will be visited.
|
is equal to \fIflags\fP will be visited.
|
||||||
If \fIfn\fP is non-zero, then this function will be executed
|
If \fIfn\fP is non-zero, then this function will be executed
|
||||||
for each name-value pair in the walk.
|
for each name-value pair in the walk.
|
||||||
The arguments to \fIfn\fP will be a pointer to the name-value pair
|
The arguments to \fIfn\fP will be a pointer to the name-value pair
|
||||||
and the \fIdata\fP pointer passed to \f3nv_scan()\fP.
|
and the \fIdata\fP pointer passed to \f3nv_scan()\fP.
|
||||||
The number of elements visited will be returned.
|
The number of elements visited will be returned.
|
||||||
|
@ -375,11 +374,11 @@ to manage the creation of sub-variables,
|
||||||
and to extend the operations permitted on a name-value pair.
|
and to extend the operations permitted on a name-value pair.
|
||||||
A discipline consists of a set of one or more functions and related
|
A discipline consists of a set of one or more functions and related
|
||||||
data that are used to override and extend the operations
|
data that are used to override and extend the operations
|
||||||
on a name-value pair.
|
on a name-value pair.
|
||||||
A discipline is defined by the types
|
A discipline is defined by the types
|
||||||
\f3Namfun_t\fP and \f3Namdisc_t\fP.
|
\f3Namfun_t\fP and \f3Namdisc_t\fP.
|
||||||
The \f3Namdisc_t\fP is not modified by any of these functions and
|
The \f3Namdisc_t\fP is not modified by any of these functions and
|
||||||
can therefore be shared by several name-value pairs.
|
can therefore be shared by several name-value pairs.
|
||||||
It contains following public fields in the order listed:
|
It contains following public fields in the order listed:
|
||||||
.nf
|
.nf
|
||||||
\f3size_t dsize;\fP
|
\f3size_t dsize;\fP
|
||||||
|
@ -460,7 +459,7 @@ builtins or functions whose name is of the
|
||||||
form \fIvarname\fP\f3.\fP\fIaction\fP to be defined.
|
form \fIvarname\fP\f3.\fP\fIaction\fP to be defined.
|
||||||
By default, each name-value pair can have a \f3get\fP,
|
By default, each name-value pair can have a \f3get\fP,
|
||||||
\f3set\fP, and \f3unset\fP discipline associated with it.
|
\f3set\fP, and \f3unset\fP discipline associated with it.
|
||||||
Whenever a builtin or function whose name is of the
|
Whenever a builtin or function whose name is of the
|
||||||
form \fIvarname\fP\f3.\fP\fIaction\fP is defined or is unset,
|
form \fIvarname\fP\f3.\fP\fIaction\fP is defined or is unset,
|
||||||
and \fIaction\fP is not \f3get\fP,
|
and \fIaction\fP is not \f3get\fP,
|
||||||
\f3set\fP, or \f3unset\fP, the \fIsetdisc\fP\f3()\fP function is invoked
|
\f3set\fP, or \f3unset\fP, the \fIsetdisc\fP\f3()\fP function is invoked
|
||||||
|
@ -557,7 +556,7 @@ A pointer to this discipline is returned.
|
||||||
.PP
|
.PP
|
||||||
The \f3nv_aindex()\fP function returns
|
The \f3nv_aindex()\fP function returns
|
||||||
the current index for
|
the current index for
|
||||||
the indexed array given by the name-value pair pointer \fInp\fP.
|
the indexed array given by the name-value pair pointer \fInp\fP.
|
||||||
The return value is negative if \fInp\fP refers to
|
The return value is negative if \fInp\fP refers to
|
||||||
an associative array.
|
an associative array.
|
||||||
.PP
|
.PP
|
||||||
|
@ -620,7 +619,7 @@ when the pointer is no longer needed.
|
||||||
The \f3nv_putsub()\fP function is used to
|
The \f3nv_putsub()\fP function is used to
|
||||||
set the subscript for the next reference to \f3np\fP.
|
set the subscript for the next reference to \f3np\fP.
|
||||||
If the \f3name\fP argument is not \f3NULL\fP,
|
If the \f3name\fP argument is not \f3NULL\fP,
|
||||||
it defines the value of the next subscript.
|
it defines the value of the next subscript.
|
||||||
The \f3mode\fP argument can contain one or more of the following flags:
|
The \f3mode\fP argument can contain one or more of the following flags:
|
||||||
.IP
|
.IP
|
||||||
\f3ARRAY_ADD\fP:
|
\f3ARRAY_ADD\fP:
|
||||||
|
@ -660,7 +659,7 @@ a shell compound assignment.
|
||||||
.PP
|
.PP
|
||||||
The \f3nv_type()\fP function returns a name_value pair pointer
|
The \f3nv_type()\fP function returns a name_value pair pointer
|
||||||
that contains the type definition for the specified name-value pair.
|
that contains the type definition for the specified name-value pair.
|
||||||
The \fInvname\fP field contains the name for the type.
|
The \fInvname\fP field contains the name for the type.
|
||||||
.PP
|
.PP
|
||||||
The \f3nv_settype()\fP function converts the name-value pair
|
The \f3nv_settype()\fP function converts the name-value pair
|
||||||
given by \fInp\fP into the type given by \fItp\fP.
|
given by \fInp\fP into the type given by \fItp\fP.
|
||||||
|
|
|
@ -383,7 +383,6 @@ is set to
|
||||||
The contents of the line read from standard input is
|
The contents of the line read from standard input is
|
||||||
saved in
|
saved in
|
||||||
the variable
|
the variable
|
||||||
.SM
|
|
||||||
.BR REPLY .
|
.BR REPLY .
|
||||||
The
|
The
|
||||||
.I list\^
|
.I list\^
|
||||||
|
@ -811,7 +810,6 @@ A
|
||||||
by itself, or in front of a
|
by itself, or in front of a
|
||||||
.BR / ,
|
.BR / ,
|
||||||
is replaced by
|
is replaced by
|
||||||
.SM
|
|
||||||
.BR $HOME ,
|
.BR $HOME ,
|
||||||
unless the
|
unless the
|
||||||
.B HOME
|
.B HOME
|
||||||
|
@ -1233,7 +1231,6 @@ is substituted,
|
||||||
separated by
|
separated by
|
||||||
the first character of
|
the first character of
|
||||||
the value of
|
the value of
|
||||||
.SM
|
|
||||||
.BR IFS .
|
.BR IFS .
|
||||||
.TP
|
.TP
|
||||||
\f3${#\fP\f2parameter\^\fP\f3}\fP
|
\f3${#\fP\f2parameter\^\fP\f3}\fP
|
||||||
|
@ -1597,7 +1594,7 @@ the new type is derived from the type of the first variable. (See
|
||||||
below.)
|
below.)
|
||||||
.TP
|
.TP
|
||||||
.B !
|
.B !
|
||||||
The process id or the pool name and job number of the last background command
|
The process ID or the pool name and job number of the last background command
|
||||||
invoked or the most recent job put in the background with the
|
invoked or the most recent job put in the background with the
|
||||||
.B bg
|
.B bg
|
||||||
built-in command.
|
built-in command.
|
||||||
|
@ -1780,7 +1777,7 @@ built-in command.
|
||||||
.TP
|
.TP
|
||||||
.B
|
.B
|
||||||
.SM PPID
|
.SM PPID
|
||||||
The process id of the parent of the shell.
|
The process ID of the parent of the shell.
|
||||||
.TP
|
.TP
|
||||||
.B
|
.B
|
||||||
.SM PWD
|
.SM PWD
|
||||||
|
@ -1794,7 +1791,6 @@ Each time this variable is referenced, a random integer,
|
||||||
uniformly distributed between 0 and 32767, is generated.
|
uniformly distributed between 0 and 32767, is generated.
|
||||||
The sequence of random numbers can be initialized by assigning
|
The sequence of random numbers can be initialized by assigning
|
||||||
a numeric value to
|
a numeric value to
|
||||||
.SM
|
|
||||||
.BR RANDOM .
|
.BR RANDOM .
|
||||||
.TP
|
.TP
|
||||||
.B
|
.B
|
||||||
|
@ -1919,7 +1915,6 @@ If an executable file with the name of that command is found,
|
||||||
then it is read and executed
|
then it is read and executed
|
||||||
in the current environment.
|
in the current environment.
|
||||||
Unlike
|
Unlike
|
||||||
.SM
|
|
||||||
.BR PATH ,
|
.BR PATH ,
|
||||||
the current directory must be represented
|
the current directory must be represented
|
||||||
explicitly by
|
explicitly by
|
||||||
|
@ -2001,11 +1996,9 @@ that belong to the \f2isspace\^\fP character class,
|
||||||
delimit a field.
|
delimit a field.
|
||||||
In addition, if the same \f2isspace\^\fP character appears
|
In addition, if the same \f2isspace\^\fP character appears
|
||||||
consecutively inside
|
consecutively inside
|
||||||
.SM
|
|
||||||
.BR IFS ,
|
.BR IFS ,
|
||||||
this character is treated as if it were not in the \f2isspace\^\fP
|
this character is treated as if it were not in the \f2isspace\^\fP
|
||||||
class, so that if
|
class, so that if
|
||||||
.SM
|
|
||||||
.BR IFS
|
.BR IFS
|
||||||
consists of two
|
consists of two
|
||||||
.B tab
|
.B tab
|
||||||
|
@ -2028,7 +2021,6 @@ starting with
|
||||||
.B
|
.B
|
||||||
.SM LC_
|
.SM LC_
|
||||||
or
|
or
|
||||||
.SM
|
|
||||||
.BR LANG .
|
.BR LANG .
|
||||||
.TP
|
.TP
|
||||||
.B
|
.B
|
||||||
|
@ -2306,11 +2298,8 @@ The shell gives default values to
|
||||||
\f3\s-1PS3\s+1\fP, \f3\s-1PS4\s+1\fP, \f3\s-1MAILCHECK\s+1\fP, \f3\s-1FCEDIT\s+1\fP,
|
\f3\s-1PS3\s+1\fP, \f3\s-1PS4\s+1\fP, \f3\s-1MAILCHECK\s+1\fP, \f3\s-1FCEDIT\s+1\fP,
|
||||||
\f3\s-1TMOUT\s+1\fP and \f3\s-1IFS\s+1\fP,
|
\f3\s-1TMOUT\s+1\fP and \f3\s-1IFS\s+1\fP,
|
||||||
while
|
while
|
||||||
.SM
|
|
||||||
.BR HOME ,
|
.BR HOME ,
|
||||||
.SM
|
|
||||||
.BR SHELL ,
|
.BR SHELL ,
|
||||||
.SM
|
|
||||||
.BR ENV ,
|
.BR ENV ,
|
||||||
and
|
and
|
||||||
.SM
|
.SM
|
||||||
|
@ -2423,7 +2412,7 @@ must both be either upper case or both be lower case characters
|
||||||
in the C locale. In this case a field is created for each character
|
in the C locale. In this case a field is created for each character
|
||||||
from
|
from
|
||||||
.I l1\^
|
.I l1\^
|
||||||
thru
|
through
|
||||||
.IR l2\^ .
|
.IR l2\^ .
|
||||||
.PP
|
.PP
|
||||||
In the remaining forms, a field is created for each number starting at
|
In the remaining forms, a field is created for each number starting at
|
||||||
|
@ -3072,7 +3061,6 @@ attribute.
|
||||||
Assigning a floating point number to a
|
Assigning a floating point number to a
|
||||||
variable whose type is an integer causes the fractional
|
variable whose type is an integer causes the fractional
|
||||||
part to be truncated.
|
part to be truncated.
|
||||||
.PP
|
|
||||||
.SS Prompting.
|
.SS Prompting.
|
||||||
When used interactively,
|
When used interactively,
|
||||||
the shell prompts with the value of
|
the shell prompts with the value of
|
||||||
|
@ -3236,12 +3224,12 @@ exists and the modification time is greater than the last access time.
|
||||||
\f3\-O\fP \f2file\fP
|
\f3\-O\fP \f2file\fP
|
||||||
True, if
|
True, if
|
||||||
.I file\^
|
.I file\^
|
||||||
exists and is owned by the effective user id of this process.
|
exists and is owned by the effective user ID of this process.
|
||||||
.TP
|
.TP
|
||||||
\f3\-G\fP \f2file\fP
|
\f3\-G\fP \f2file\fP
|
||||||
True, if
|
True, if
|
||||||
.I file\^
|
.I file\^
|
||||||
exists and its group matches the effective group id of this process.
|
exists and its group matches the effective group ID of this process.
|
||||||
.TP
|
.TP
|
||||||
\f3\-R\fP \f2name\fP
|
\f3\-R\fP \f2name\fP
|
||||||
True if variable
|
True if variable
|
||||||
|
@ -3489,8 +3477,8 @@ built-ins.
|
||||||
Use file
|
Use file
|
||||||
.I word\^
|
.I word\^
|
||||||
as standard output.
|
as standard output.
|
||||||
If the file exists, then output is appended to it (by first seeking to the end-of-file);
|
If the file exists, then output is appended to it (by
|
||||||
otherwise, the file is created.
|
first seeking to the end-of-file); otherwise, the file is created.
|
||||||
.TP
|
.TP
|
||||||
.BI <> word
|
.BI <> word
|
||||||
Open file
|
Open file
|
||||||
|
@ -3701,9 +3689,9 @@ first associates file descriptor 1 with file
|
||||||
It then associates file descriptor 2 with the file associated with file
|
It then associates file descriptor 2 with the file associated with file
|
||||||
descriptor 1 (i.e.
|
descriptor 1 (i.e.
|
||||||
.IR fname\^ ).
|
.IR fname\^ ).
|
||||||
If the order of redirections were reversed, file descriptor 2 would be associated
|
If the order of redirections were reversed, file descriptor 2
|
||||||
with the terminal (assuming file descriptor 1 had been) and then file descriptor
|
would be associated with the terminal (assuming file descriptor 1 had
|
||||||
1 would be associated with file
|
been) and then file descriptor 1 would be associated with file
|
||||||
.IR fname\^ .
|
.IR fname\^ .
|
||||||
.PP
|
.PP
|
||||||
If a command is followed by
|
If a command is followed by
|
||||||
|
@ -3799,7 +3787,6 @@ for early versions of the shell and its use in new scripts
|
||||||
is strongly discouraged.
|
is strongly discouraged.
|
||||||
It is likely to disappear someday.
|
It is likely to disappear someday.
|
||||||
.SS Functions.
|
.SS Functions.
|
||||||
.PP
|
|
||||||
For historical reasons, there are two
|
For historical reasons, there are two
|
||||||
ways to define functions,
|
ways to define functions,
|
||||||
the
|
the
|
||||||
|
@ -4093,7 +4080,6 @@ command with the
|
||||||
and no option argument or operands will write all the type definitions to
|
and no option argument or operands will write all the type definitions to
|
||||||
standard output in a form that can be read in to create all they types.
|
standard output in a form that can be read in to create all they types.
|
||||||
.SS Jobs.
|
.SS Jobs.
|
||||||
.PP
|
|
||||||
If the
|
If the
|
||||||
.B monitor
|
.B monitor
|
||||||
option of the
|
option of the
|
||||||
|
@ -4113,7 +4099,7 @@ like:
|
||||||
[1] 1234
|
[1] 1234
|
||||||
.PP
|
.PP
|
||||||
indicating that the job which was started asynchronously was job number
|
indicating that the job which was started asynchronously was job number
|
||||||
1 and had one (top-level) process, whose process id was 1234.
|
1 and had one (top-level) process, whose process ID was 1234.
|
||||||
.PP
|
.PP
|
||||||
This paragraph and the next require features that are
|
This paragraph and the next require features that are
|
||||||
not in all versions of UNIX and may not apply.
|
not in all versions of UNIX and may not apply.
|
||||||
|
@ -4147,7 +4133,7 @@ A job pool is a collection of jobs started with
|
||||||
associated with a name.
|
associated with a name.
|
||||||
.PP
|
.PP
|
||||||
There are several ways to refer to jobs in the shell.
|
There are several ways to refer to jobs in the shell.
|
||||||
A job can be referred to by the process id of any process of the job
|
A job can be referred to by the process ID of any process of the job
|
||||||
or by one of the following:
|
or by one of the following:
|
||||||
.PD 0
|
.PD 0
|
||||||
.TP
|
.TP
|
||||||
|
@ -4408,7 +4394,6 @@ A shell can access the commands of
|
||||||
all
|
all
|
||||||
.I interactive
|
.I interactive
|
||||||
shells which use the same named
|
shells which use the same named
|
||||||
.SM
|
|
||||||
.BR HISTFILE .
|
.BR HISTFILE .
|
||||||
The built-in command
|
The built-in command
|
||||||
.B hist\^
|
.B hist\^
|
||||||
|
@ -4672,11 +4657,9 @@ in question, which are indicated in parentheses.
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI ^F
|
.BI ^F
|
||||||
Move cursor forward (right) one character.
|
Move cursor forward (right) one character.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M-[C
|
.BI M-[C
|
||||||
(Right arrow) Same as \fB^F\fR.
|
(Right arrow) Same as \fB^F\fR.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M-f
|
.BI M-f
|
||||||
Move cursor forward one word.
|
Move cursor forward one word.
|
||||||
|
@ -4684,55 +4667,43 @@ Move cursor forward one word.
|
||||||
.B emacs
|
.B emacs
|
||||||
editor's idea of a word is a string of characters
|
editor's idea of a word is a string of characters
|
||||||
consisting of only letters, digits and underscores.)
|
consisting of only letters, digits and underscores.)
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI ^B
|
.BI ^B
|
||||||
Move cursor backward (left) one character.
|
Move cursor backward (left) one character.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M-[D
|
.BI M-[D
|
||||||
(Left arrow) Same as \fB^B\fR.
|
(Left arrow) Same as \fB^B\fR.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M-b
|
.BI M-b
|
||||||
Move cursor backward one word.
|
Move cursor backward one word.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI ^A
|
.BI ^A
|
||||||
Move cursor to start of line.
|
Move cursor to start of line.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M-[H
|
.BI M-[H
|
||||||
(Home) Same as \fB^A\fR.
|
(Home) Same as \fB^A\fR.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI ^E
|
.BI ^E
|
||||||
Move cursor to end of line.
|
Move cursor to end of line.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M-[F
|
.BI M-[F
|
||||||
(End) Same as \fB^E\fR.
|
(End) Same as \fB^E\fR.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M-[Y
|
.BI M-[Y
|
||||||
Same as \fB^E\fR.
|
Same as \fB^E\fR.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI ^] char
|
.BI ^] char
|
||||||
Move cursor forward to character
|
Move cursor forward to character
|
||||||
.I char
|
.I char
|
||||||
on current line.
|
on current line.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M-^] char
|
.BI M-^] char
|
||||||
Move cursor backward to character
|
Move cursor backward to character
|
||||||
.I char
|
.I char
|
||||||
on current line.
|
on current line.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI ^X^X
|
.BI ^X^X
|
||||||
Interchange the cursor and mark.
|
Interchange the cursor and mark.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.I erase
|
.I erase
|
||||||
(User defined erase character as defined
|
(User defined erase character as defined
|
||||||
|
@ -4741,7 +4712,6 @@ by the
|
||||||
command, usually
|
command, usually
|
||||||
.B ^H .)
|
.B ^H .)
|
||||||
Delete previous character.
|
Delete previous character.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.I lnext
|
.I lnext
|
||||||
(User defined literal next character as defined
|
(User defined literal next character as defined
|
||||||
|
@ -4753,33 +4723,26 @@ or
|
||||||
if not defined.)
|
if not defined.)
|
||||||
Removes the next character's
|
Removes the next character's
|
||||||
editing features (if any).
|
editing features (if any).
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI ^D
|
.BI ^D
|
||||||
Delete current character.
|
Delete current character.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M-[3~
|
.BI M-[3~
|
||||||
(Forward delete) Same as \fB^D\fR.
|
(Forward delete) Same as \fB^D\fR.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M-d
|
.BI M-d
|
||||||
Delete current word.
|
Delete current word.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M-^H
|
.BI M-^H
|
||||||
(Meta-backspace) Delete previous word.
|
(Meta-backspace) Delete previous word.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M-h
|
.BI M-h
|
||||||
Delete previous word.
|
Delete previous word.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M-^?
|
.BI M-^?
|
||||||
(Meta-DEL) Delete previous word (if your interrupt character is
|
(Meta-DEL) Delete previous word (if your interrupt character is
|
||||||
.B ^?
|
.B ^?
|
||||||
(DEL, the default) then this command will not work).
|
(DEL, the default) then this command will not work).
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI ^T
|
.BI ^T
|
||||||
Transpose current character with previous character
|
Transpose current character with previous character
|
||||||
|
@ -4790,19 +4753,15 @@ mode.
|
||||||
Transpose two previous characters in
|
Transpose two previous characters in
|
||||||
.I gmacs
|
.I gmacs
|
||||||
mode.
|
mode.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI ^C
|
.BI ^C
|
||||||
Capitalize current character.
|
Capitalize current character.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M-c
|
.BI M-c
|
||||||
Capitalize current word.
|
Capitalize current word.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M-l
|
.BI M-l
|
||||||
Change the current word to lower case.
|
Change the current word to lower case.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI ^K
|
.BI ^K
|
||||||
Delete from the cursor to the end of the line.
|
Delete from the cursor to the end of the line.
|
||||||
|
@ -4812,15 +4771,12 @@ up to the cursor.
|
||||||
If preceded by a numerical parameter whose value is greater than the
|
If preceded by a numerical parameter whose value is greater than the
|
||||||
current cursor position, then delete from cursor up to
|
current cursor position, then delete from cursor up to
|
||||||
given cursor position.
|
given cursor position.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI ^W
|
.BI ^W
|
||||||
Kill from the cursor to the mark.
|
Kill from the cursor to the mark.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M-p
|
.BI M-p
|
||||||
Push the region from the cursor to the mark on the stack.
|
Push the region from the cursor to the mark on the stack.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.I kill
|
.I kill
|
||||||
(User defined kill character as defined
|
(User defined kill character as defined
|
||||||
|
@ -4835,35 +4791,27 @@ kill characters from then on cause a line feed
|
||||||
A subsequent pair of
|
A subsequent pair of
|
||||||
.I kill
|
.I kill
|
||||||
characters undoes this change.
|
characters undoes this change.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI ^Y
|
.BI ^Y
|
||||||
Restore last item removed from line. (Yank item back to the line.)
|
Restore last item removed from line. (Yank item back to the line.)
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI ^L
|
.BI ^L
|
||||||
Line feed and print current line.
|
Line feed and print current line.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M-^L
|
.BI M-^L
|
||||||
Clear the screen.
|
Clear the screen.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI ^@
|
.BI ^@
|
||||||
(Null character) Set mark.
|
(Null character) Set mark.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M- space
|
.BI M- space
|
||||||
(Meta space) Set mark.
|
(Meta space) Set mark.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI ^J
|
.BI ^J
|
||||||
(New\ line) Execute the current line.
|
(New\ line) Execute the current line.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI ^M
|
.BI ^M
|
||||||
(Return) Execute the current line.
|
(Return) Execute the current line.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.I eof
|
.I eof
|
||||||
End-of-file character,
|
End-of-file character,
|
||||||
|
@ -4871,7 +4819,6 @@ normally
|
||||||
.BR ^D ,
|
.BR ^D ,
|
||||||
is processed as an End-of-file only
|
is processed as an End-of-file only
|
||||||
if the current line is null.
|
if the current line is null.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI ^P
|
.BI ^P
|
||||||
Fetch previous command.
|
Fetch previous command.
|
||||||
|
@ -4880,7 +4827,6 @@ Each time
|
||||||
is entered
|
is entered
|
||||||
the previous command back in time is accessed.
|
the previous command back in time is accessed.
|
||||||
Moves back one line when not on the first line of a multi-line command.
|
Moves back one line when not on the first line of a multi-line command.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M-[A
|
.BI M-[A
|
||||||
(Up arrow)
|
(Up arrow)
|
||||||
|
@ -4892,15 +4838,12 @@ set to the contents of the current line.
|
||||||
Otherwise, it is
|
Otherwise, it is
|
||||||
equivalent to
|
equivalent to
|
||||||
.BR ^P .
|
.BR ^P .
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M-<
|
.BI M-<
|
||||||
Fetch the least recent (oldest) history line.
|
Fetch the least recent (oldest) history line.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M->
|
.BI M->
|
||||||
Fetch the most recent (youngest) history line.
|
Fetch the most recent (youngest) history line.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI ^N
|
.BI ^N
|
||||||
Fetch next command line.
|
Fetch next command line.
|
||||||
|
@ -4908,13 +4851,11 @@ Each time
|
||||||
.B ^N
|
.B ^N
|
||||||
is entered
|
is entered
|
||||||
the next command line forward in time is accessed.
|
the next command line forward in time is accessed.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M-[B
|
.BI M-[B
|
||||||
(Down arrow)
|
(Down arrow)
|
||||||
Equivalent to
|
Equivalent to
|
||||||
.BR ^N .
|
.BR ^N .
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI ^R string
|
.BI ^R string
|
||||||
Reverse search history for a previous command line containing
|
Reverse search history for a previous command line containing
|
||||||
|
@ -4934,13 +4875,11 @@ then the next command line containing the most recent
|
||||||
is accessed.
|
is accessed.
|
||||||
In this case a parameter of zero
|
In this case a parameter of zero
|
||||||
reverses the direction of the search.
|
reverses the direction of the search.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.B ^O
|
.B ^O
|
||||||
Operate \- Execute the current line and fetch
|
Operate \- Execute the current line and fetch
|
||||||
the next line relative to current line from the
|
the next line relative to current line from the
|
||||||
history file.
|
history file.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M- digits
|
.BI M- digits
|
||||||
(Escape) Define numeric parameter, the digits
|
(Escape) Define numeric parameter, the digits
|
||||||
|
@ -4968,7 +4907,6 @@ The commands that accept a parameter are
|
||||||
.BR M-l ,
|
.BR M-l ,
|
||||||
.BR M-^H ,
|
.BR M-^H ,
|
||||||
and the arrow keys and forward-delete key.
|
and the arrow keys and forward-delete key.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M- letter
|
.BI M- letter
|
||||||
Soft-key \- Your alias list is searched for an
|
Soft-key \- Your alias list is searched for an
|
||||||
|
@ -4979,7 +4917,6 @@ value will be inserted on the input queue.
|
||||||
The
|
The
|
||||||
.I letter
|
.I letter
|
||||||
must not be one of the above meta-functions.
|
must not be one of the above meta-functions.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI M-[ letter
|
.BI M-[ letter
|
||||||
Soft-key \- Your alias list is searched for an
|
Soft-key \- Your alias list is searched for an
|
||||||
|
@ -4988,7 +4925,6 @@ alias by the name
|
||||||
and if an alias of this name is defined, its
|
and if an alias of this name is defined, its
|
||||||
value will be inserted on the input queue.
|
value will be inserted on the input queue.
|
||||||
This can be used to program function keys on many terminals.
|
This can be used to program function keys on many terminals.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.B M-.
|
.B M-.
|
||||||
The last word of the previous command is inserted
|
The last word of the previous command is inserted
|
||||||
|
@ -4996,23 +4932,19 @@ on the line.
|
||||||
If preceded by a numeric parameter, the value
|
If preceded by a numeric parameter, the value
|
||||||
of this parameter determines which word to insert rather than
|
of this parameter determines which word to insert rather than
|
||||||
the last word.
|
the last word.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.B M-_
|
.B M-_
|
||||||
Same as
|
Same as
|
||||||
.BR M-. .
|
.BR M-. .
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.B M-*
|
.B M-*
|
||||||
Attempt pathname expansion on the current word.
|
Attempt pathname expansion on the current word.
|
||||||
An asterisk is appended if the word doesn't match any file
|
An asterisk is appended if the word doesn't match any file
|
||||||
or contain any special
|
or contain any special
|
||||||
pattern characters.
|
pattern characters.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.B M-ESC
|
.B M-ESC
|
||||||
Command or file name completion as described above.
|
Command or file name completion as described above.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI ^I " tab"
|
.BI ^I " tab"
|
||||||
Attempts command or file name completion as described above.
|
Attempts command or file name completion as described above.
|
||||||
|
@ -5025,7 +4957,6 @@ If no match is found or entered after
|
||||||
a
|
a
|
||||||
.I tab\^
|
.I tab\^
|
||||||
is inserted.
|
is inserted.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.B M-=
|
.B M-=
|
||||||
If not preceded by a numeric parameter,
|
If not preceded by a numeric parameter,
|
||||||
|
@ -5035,16 +4966,15 @@ Otherwise, the word under the cursor is replaced by
|
||||||
the item corresponding to the value of the numeric parameter
|
the item corresponding to the value of the numeric parameter
|
||||||
from the most recently generated command or file list.
|
from the most recently generated command or file list.
|
||||||
If the cursor is not on a word, it is inserted instead.
|
If the cursor is not on a word, it is inserted instead.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI ^U
|
.BI ^U
|
||||||
Multiply parameter of next command by 4.
|
Multiply parameter of next command by 4.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.BI \e
|
.BI \e
|
||||||
If the
|
If the
|
||||||
.B backslashctrl
|
.B backslashctrl
|
||||||
shell option is on (which is the default setting), this escapes the next character.
|
shell option is on (which is the default setting), this escapes
|
||||||
|
the next character.
|
||||||
Editing characters, the user's erase, kill and
|
Editing characters, the user's erase, kill and
|
||||||
interrupt (normally
|
interrupt (normally
|
||||||
.BR ^C )
|
.BR ^C )
|
||||||
|
@ -5059,11 +4989,9 @@ editing features (if any).
|
||||||
See also
|
See also
|
||||||
.I lnext
|
.I lnext
|
||||||
which is not subject to any shell option.
|
which is not subject to any shell option.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.B M-^V
|
.B M-^V
|
||||||
Display version of the shell.
|
Display version of the shell.
|
||||||
.PP
|
|
||||||
.TP 10
|
.TP 10
|
||||||
.B M-#
|
.B M-#
|
||||||
If the line does not begin with a
|
If the line does not begin with a
|
||||||
|
@ -5120,7 +5048,6 @@ These sequences can use preceding repeat count parameters, but only when the
|
||||||
\fB^[\fR and the subsequent \fB[\fR are entered into the input buffer at the
|
\fB^[\fR and the subsequent \fB[\fR are entered into the input buffer at the
|
||||||
same time, such as when pressing one of those keys.
|
same time, such as when pressing one of those keys.
|
||||||
.SS "\ \ \ \ \ Input Edit Commands"
|
.SS "\ \ \ \ \ Input Edit Commands"
|
||||||
.PP
|
|
||||||
.RS
|
.RS
|
||||||
By default the editor is in input mode.
|
By default the editor is in input mode.
|
||||||
.PD 0
|
.PD 0
|
||||||
|
@ -5870,7 +5797,6 @@ substitutes the string
|
||||||
for the string
|
for the string
|
||||||
.I old
|
.I old
|
||||||
in the current directory name,
|
in the current directory name,
|
||||||
.SM
|
|
||||||
.BR PWD ,
|
.BR PWD ,
|
||||||
and tries to change to this new directory.
|
and tries to change to this new directory.
|
||||||
.sp .5
|
.sp .5
|
||||||
|
@ -5955,7 +5881,6 @@ option causes
|
||||||
the operating system's standard utilities path
|
the operating system's standard utilities path
|
||||||
(as output by \f3getconf PATH\fP) to be searched
|
(as output by \f3getconf PATH\fP) to be searched
|
||||||
rather than the one defined by the value of
|
rather than the one defined by the value of
|
||||||
.SM
|
|
||||||
.BR PATH .
|
.BR PATH .
|
||||||
.IP
|
.IP
|
||||||
The
|
The
|
||||||
|
@ -6258,12 +6183,10 @@ begins with a
|
||||||
The index of the next
|
The index of the next
|
||||||
.I arg
|
.I arg
|
||||||
is stored in
|
is stored in
|
||||||
.SM
|
|
||||||
.BR OPTIND .
|
.BR OPTIND .
|
||||||
The option argument,
|
The option argument,
|
||||||
if any,
|
if any,
|
||||||
gets stored in
|
gets stored in
|
||||||
.SM
|
|
||||||
.BR OPTARG .
|
.BR OPTARG .
|
||||||
.sp .5
|
.sp .5
|
||||||
A leading
|
A leading
|
||||||
|
@ -6274,7 +6197,6 @@ causes
|
||||||
.B getopts
|
.B getopts
|
||||||
to store the letter of an invalid
|
to store the letter of an invalid
|
||||||
option in
|
option in
|
||||||
.SM
|
|
||||||
.BR OPTARG ,
|
.BR OPTARG ,
|
||||||
and to set
|
and to set
|
||||||
.I vname
|
.I vname
|
||||||
|
@ -6409,7 +6331,7 @@ Lists information about each given job; or all active jobs if
|
||||||
is omitted.
|
is omitted.
|
||||||
The
|
The
|
||||||
.B \-l
|
.B \-l
|
||||||
option lists process ids in addition to the normal information.
|
option lists process IDs in addition to the normal information.
|
||||||
The
|
The
|
||||||
.B \-n
|
.B \-n
|
||||||
option only displays jobs that have stopped or exited since last
|
option only displays jobs that have stopped or exited since last
|
||||||
|
@ -6453,7 +6375,7 @@ then the job or process will be sent a CONT (continue) signal
|
||||||
if it is stopped.
|
if it is stopped.
|
||||||
The argument
|
The argument
|
||||||
.I job\^
|
.I job\^
|
||||||
can be the process id of a process that is not a member of one of the
|
can be the process ID of a process that is not a member of one of the
|
||||||
active jobs.
|
active jobs.
|
||||||
See
|
See
|
||||||
.I Jobs
|
.I Jobs
|
||||||
|
@ -6769,11 +6691,13 @@ The
|
||||||
flag, when used with the
|
flag, when used with the
|
||||||
.B %d
|
.B %d
|
||||||
format without an output base,
|
format without an output base,
|
||||||
displays the output in powers of 1000 indicated by one of the following suffixes:
|
displays the output in powers of 1000 indicated by one of the
|
||||||
|
following suffixes:
|
||||||
.BR "k M G T P E" ,
|
.BR "k M G T P E" ,
|
||||||
and when used with the
|
and when used with the
|
||||||
.B %i
|
.B %i
|
||||||
format displays the output in powers of 1024 indicated by one of the following suffixes:
|
format displays the output in powers of 1024 indicated by one of
|
||||||
|
the following suffixes:
|
||||||
.BR "Ki Mi Gi Ti Pi Ei" .
|
.BR "Ki Mi Gi Ti Pi Ei" .
|
||||||
.TP
|
.TP
|
||||||
.B =
|
.B =
|
||||||
|
@ -6801,7 +6725,6 @@ formats, separates groups of digits with the grouping delimiter
|
||||||
.RB ( ,
|
.RB ( ,
|
||||||
on groups of 3 in the C locale).
|
on groups of 3 in the C locale).
|
||||||
.PD
|
.PD
|
||||||
.PP
|
|
||||||
.TP
|
.TP
|
||||||
The \f3\-v\fP option assigns the output directly to a variable instead of
|
The \f3\-v\fP option assigns the output directly to a variable instead of
|
||||||
writing it to standard output. This is faster than capturing the output using a
|
writing it to standard output. This is faster than capturing the output using a
|
||||||
|
@ -7122,7 +7045,8 @@ Each command
|
||||||
becomes a tracked alias when first encountered.
|
becomes a tracked alias when first encountered.
|
||||||
.TP 8
|
.TP 8
|
||||||
.B \-k
|
.B \-k
|
||||||
(Obsolete). All variable assignment arguments are placed in the environment for a command,
|
(Obsolete).
|
||||||
|
All variable assignment arguments are placed in the environment for a command,
|
||||||
not just those that precede the command name.
|
not just those that precede the command name.
|
||||||
.TP 8
|
.TP 8
|
||||||
.B \-m
|
.B \-m
|
||||||
|
@ -7275,7 +7199,8 @@ is automatically turned on upon invocation if ksh is invoked as \fBsh\fR
|
||||||
or \fBrsh\fR. In that case, or if the option is turned on by
|
or \fBrsh\fR. In that case, or if the option is turned on by
|
||||||
specifying \fB-o posix\fR on the invocation command line, the invoked shell
|
specifying \fB-o posix\fR on the invocation command line, the invoked shell
|
||||||
will not set the preset aliases even if interactive, and will not import type
|
will not set the preset aliases even if interactive, and will not import type
|
||||||
attributes for variables (such as integer or left/right justify) from the environment.
|
attributes for variables (such as integer or left/right justify)
|
||||||
|
from the environment.
|
||||||
.RS 8
|
.RS 8
|
||||||
.PP
|
.PP
|
||||||
In addition, while on, the \fBposix\fR option
|
In addition, while on, the \fBposix\fR option
|
||||||
|
@ -7377,10 +7302,10 @@ instead of the
|
||||||
.SM
|
.SM
|
||||||
.B ENV
|
.B ENV
|
||||||
file.
|
file.
|
||||||
This mode is on whenever the effective uid (gid)
|
This mode is on whenever the effective UID (GID)
|
||||||
is not equal to the real uid (gid).
|
is not equal to the real UID (GID).
|
||||||
Turning this off causes the effective uid and gid to be
|
Turning this off causes the effective UID and GID to be
|
||||||
set to the real uid and gid.
|
set to the real UID and GID.
|
||||||
.TP 8
|
.TP 8
|
||||||
.B \-r
|
.B \-r
|
||||||
Enables the restricted shell. This option cannot be unset
|
Enables the restricted shell. This option cannot be unset
|
||||||
|
@ -7643,7 +7568,6 @@ on exit from the shell.
|
||||||
If
|
If
|
||||||
.I sig\^
|
.I sig\^
|
||||||
is
|
is
|
||||||
.SM
|
|
||||||
.BR KEYBD ,
|
.BR KEYBD ,
|
||||||
then
|
then
|
||||||
.I action\^
|
.I action\^
|
||||||
|
@ -7857,9 +7781,12 @@ and
|
||||||
.BR \-x .
|
.BR \-x .
|
||||||
The \-S
|
The \-S
|
||||||
can be used with discipline functions defined in a type to indicate that
|
can be used with discipline functions defined in a type to indicate that
|
||||||
the function is static. For a static function, the same method will be used by all instances of that type no matter which instance references it. In addition,
|
the function is static.
|
||||||
it can only use value of variables from the original type definition. These
|
For a static function, the same method will be used by all instances of
|
||||||
discipline functions cannot be redefined in any type instance.
|
that type no matter which instance references it.
|
||||||
|
In addition, it can only use value of variables from the original
|
||||||
|
type definition.
|
||||||
|
These discipline functions cannot be redefined in any type instance.
|
||||||
The
|
The
|
||||||
.B \-t
|
.B \-t
|
||||||
option
|
option
|
||||||
|
@ -8162,8 +8089,8 @@ The number of 512-byte blocks for pipe buffering.
|
||||||
The message queue size in K-bytes.
|
The message queue size in K-bytes.
|
||||||
.TP
|
.TP
|
||||||
.B \-R
|
.B \-R
|
||||||
The max time a real-time process can run before blocking, in microseconds. If this limit is exceeded
|
The max time a real-time process can run before blocking, in microseconds.
|
||||||
the process is sent a
|
If this limit is exceeded the process is sent a
|
||||||
.B SIGXCPU
|
.B SIGXCPU
|
||||||
signal.
|
signal.
|
||||||
.TP
|
.TP
|
||||||
|
@ -8267,19 +8194,12 @@ that it references.
|
||||||
The default is equivalent to
|
The default is equivalent to
|
||||||
.BR \-v .
|
.BR \-v .
|
||||||
Unsetting
|
Unsetting
|
||||||
.SM
|
|
||||||
.BR LINENO ,
|
.BR LINENO ,
|
||||||
.SM
|
|
||||||
.BR MAILCHECK ,
|
.BR MAILCHECK ,
|
||||||
.SM
|
|
||||||
.BR OPTARG ,
|
.BR OPTARG ,
|
||||||
.SM
|
|
||||||
.BR OPTIND ,
|
.BR OPTIND ,
|
||||||
.SM
|
|
||||||
.BR RANDOM ,
|
.BR RANDOM ,
|
||||||
.SM
|
|
||||||
.BR SECONDS ,
|
.BR SECONDS ,
|
||||||
.SM
|
|
||||||
.BR TMOUT ,
|
.BR TMOUT ,
|
||||||
and
|
and
|
||||||
.SM
|
.SM
|
||||||
|
@ -8493,7 +8413,8 @@ is also specified.
|
||||||
If the
|
If the
|
||||||
.B \-i
|
.B \-i
|
||||||
option is present or
|
option is present or
|
||||||
if the shell's standard input and standard error are attached to a terminal (as told by
|
if the shell's standard input and standard error are attached
|
||||||
|
to a terminal (as told by
|
||||||
.IR tcgetattr (3)),
|
.IR tcgetattr (3)),
|
||||||
then this shell is
|
then this shell is
|
||||||
.IR interactive .
|
.IR interactive .
|
||||||
|
@ -8541,14 +8462,10 @@ changing directory (see
|
||||||
.IR cd (1)),
|
.IR cd (1)),
|
||||||
.br
|
.br
|
||||||
setting or unsetting the value or attributes of
|
setting or unsetting the value or attributes of
|
||||||
.SM
|
|
||||||
.BR SHELL ,
|
.BR SHELL ,
|
||||||
.SM
|
|
||||||
.BR ENV ,
|
.BR ENV ,
|
||||||
.SM
|
|
||||||
.BR FPATH ,
|
.BR FPATH ,
|
||||||
or
|
or
|
||||||
.SM
|
|
||||||
.BR PATH\*S,
|
.BR PATH\*S,
|
||||||
.br
|
.br
|
||||||
specifying path or
|
specifying path or
|
||||||
|
@ -8650,7 +8567,7 @@ is not set.
|
||||||
.TP
|
.TP
|
||||||
.B /etc/suid_profile
|
.B /etc/suid_profile
|
||||||
Alternative initialization file, executed instead of the personal initialization
|
Alternative initialization file, executed instead of the personal initialization
|
||||||
file when the real and effective user or group id do not match.
|
file when the real and effective user or group ID do not match.
|
||||||
.TP
|
.TP
|
||||||
.B /dev/null
|
.B /dev/null
|
||||||
NULL device
|
NULL device
|
||||||
|
@ -8698,7 +8615,6 @@ Prentice Hall, 1995.
|
||||||
.IR "POSIX \- Part 2: Shell and Utilities" ,
|
.IR "POSIX \- Part 2: Shell and Utilities" ,
|
||||||
IEEE Std 1003.2-1992, ISO/IEC 9945-2, IEEE, 1993.
|
IEEE Std 1003.2-1992, ISO/IEC 9945-2, IEEE, 1993.
|
||||||
.SH CAVEATS
|
.SH CAVEATS
|
||||||
.PP
|
|
||||||
If a command
|
If a command
|
||||||
is executed, and then a command with the same name is
|
is executed, and then a command with the same name is
|
||||||
installed in a directory in the search path before the directory where the
|
installed in a directory in the search path before the directory where the
|
||||||
|
|
|
@ -1692,7 +1692,7 @@ The digits are represented by the characters
|
||||||
For bases less than or equal to 36,
|
For bases less than or equal to 36,
|
||||||
upper and lower case characters can
|
upper and lower case characters can
|
||||||
be used interchangeably to represent the digits
|
be used interchangeably to represent the digits
|
||||||
from 10 thru 35.
|
from 10 through 35.
|
||||||
.P
|
.P
|
||||||
Arithmetic expressions are made from constants,
|
Arithmetic expressions are made from constants,
|
||||||
variables, and operators.
|
variables, and operators.
|
||||||
|
@ -2836,7 +2836,7 @@ Assignment to this variable sets the seed for the
|
||||||
random number generator.
|
random number generator.
|
||||||
.P
|
.P
|
||||||
The parameter \fB\s-1PPID\s+1\fP
|
The parameter \fB\s-1PPID\s+1\fP
|
||||||
is used to generate the process id of the process which invoked this shell.
|
is used to generate the process ID of the process which invoked this shell.
|
||||||
.H 2 "Added Traps"
|
.H 2 "Added Traps"
|
||||||
A new trap named
|
A new trap named
|
||||||
\fB\s-1ERR\s+1\fP
|
\fB\s-1ERR\s+1\fP
|
||||||
|
@ -3007,8 +3007,8 @@ in his or her local bin, then the same technique described above can
|
||||||
be employed to compromise the security of the system.
|
be employed to compromise the security of the system.
|
||||||
To close up this and other security holes,
|
To close up this and other security holes,
|
||||||
\f5ksh\fP
|
\f5ksh\fP
|
||||||
resets the effective user id to the real user id and the effective
|
resets the effective user ID to the real user ID and the effective
|
||||||
group id to the real group id unless the
|
group ID to the real group ID unless the
|
||||||
.I privileged
|
.I privileged
|
||||||
option
|
option
|
||||||
.RB ( \-p\^ )
|
.RB ( \-p\^ )
|
||||||
|
@ -3046,7 +3046,7 @@ If the
|
||||||
or
|
or
|
||||||
.I setgid
|
.I setgid
|
||||||
bits are on for this file, then the interpreter
|
bits are on for this file, then the interpreter
|
||||||
is run with the effective uid and/or gid set accordingly.
|
is run with the effective UID and/or GID set accordingly.
|
||||||
This scheme has three major drawbacks.
|
This scheme has three major drawbacks.
|
||||||
First of all,
|
First of all,
|
||||||
putting the pathname of the interpreter into the script
|
putting the pathname of the interpreter into the script
|
||||||
|
|
|
@ -97,7 +97,7 @@ pid_t pid_fromstring(char *str)
|
||||||
pid = (pid_t)strtol(str, &last, 10);
|
pid = (pid_t)strtol(str, &last, 10);
|
||||||
if(errno==ERANGE || *last)
|
if(errno==ERANGE || *last)
|
||||||
{
|
{
|
||||||
errormsg(SH_DICT,ERROR_exit(1),"%s: invalid process id",str);
|
errormsg(SH_DICT,ERROR_exit(1),"%s: invalid process ID",str);
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
return(pid);
|
return(pid);
|
||||||
|
@ -299,7 +299,7 @@ int job_reap(register int sig)
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if(sfprintf(sfstderr,"ksh: job line %4d: reap pid=%d critical=%d signal=%d\n",__LINE__,sh.current_pid,job.in_critical,sig) <=0)
|
if(sfprintf(sfstderr,"ksh: job line %4d: reap PID=%d critical=%d signal=%d\n",__LINE__,sh.current_pid,job.in_critical,sig) <=0)
|
||||||
write(2,"waitsafe\n",9);
|
write(2,"waitsafe\n",9);
|
||||||
sfsync(sfstderr);
|
sfsync(sfstderr);
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
|
@ -347,7 +347,7 @@ int job_reap(register int sig)
|
||||||
if(!(pw=job_bypid(pid)))
|
if(!(pw=job_bypid(pid)))
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
sfprintf(sfstderr,"ksh: job line %4d: reap pid=%d critical=%d unknown job pid=%d pw=%x\n",__LINE__,sh.current_pid,job.in_critical,pid,pw);
|
sfprintf(sfstderr,"ksh: job line %4d: reap PID=%d critical=%d unknown job PID=%d pw=%x\n",__LINE__,sh.current_pid,job.in_critical,pid,pw);
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
if (WIFCONTINUED(wstat) && wcontinued)
|
if (WIFCONTINUED(wstat) && wcontinued)
|
||||||
continue;
|
continue;
|
||||||
|
@ -452,7 +452,7 @@ int job_reap(register int sig)
|
||||||
jp->exitval |= SH_EXITSIG;
|
jp->exitval |= SH_EXITSIG;
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
sfprintf(sfstderr,"ksh: job line %4d: reap pid=%d critical=%d job %d with pid %d flags=%o complete with status=%x exit=%d\n",__LINE__,sh.current_pid,job.in_critical,pw->p_job,pid,pw->p_flag,wstat,pw->p_exit);
|
sfprintf(sfstderr,"ksh: job line %4d: reap PID=%d critical=%d job %d with PID %d flags=%o complete with status=%x exit=%d\n",__LINE__,sh.current_pid,job.in_critical,pw->p_job,pid,pw->p_flag,wstat,pw->p_exit);
|
||||||
sfsync(sfstderr);
|
sfsync(sfstderr);
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
/* only top-level process in job should have notify set */
|
/* only top-level process in job should have notify set */
|
||||||
|
@ -890,7 +890,7 @@ int job_walk(Sfio_t *file,int (*fun)(struct process*,int),int arg,char *joblist[
|
||||||
* list the given job
|
* list the given job
|
||||||
* flag JOB_LFLAG for long listing
|
* flag JOB_LFLAG for long listing
|
||||||
* flag JOB_NFLAG for list only jobs marked for notification
|
* flag JOB_NFLAG for list only jobs marked for notification
|
||||||
* flag JOB_PFLAG for process id(s) only
|
* flag JOB_PFLAG for process ID(s) only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int job_list(struct process *pw,register int flag)
|
int job_list(struct process *pw,register int flag)
|
||||||
|
@ -1203,7 +1203,7 @@ void job_clear(void)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* put the process <pid> on the process list and return the job number
|
* put the process <pid> on the process list and return the job number
|
||||||
* if non-zero, <join> is the process id of the job to join
|
* if non-zero, <join> is the process ID of the job to join
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int job_post(pid_t pid, pid_t join)
|
int job_post(pid_t pid, pid_t join)
|
||||||
|
@ -1287,7 +1287,7 @@ int job_post(pid_t pid, pid_t join)
|
||||||
pw->p_fgrp = 0;
|
pw->p_fgrp = 0;
|
||||||
pw->p_pgrp = pw->p_fgrp;
|
pw->p_pgrp = pw->p_fgrp;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
sfprintf(sfstderr,"ksh: job line %4d: post pid=%d critical=%d job=%d pid=%d pgid=%d savesig=%d join=%d\n",__LINE__,sh.current_pid,job.in_critical,pw->p_job,
|
sfprintf(sfstderr,"ksh: job line %4d: post PID=%d critical=%d job=%d PID=%d PGID=%d savesig=%d join=%d\n",__LINE__,sh.current_pid,job.in_critical,pw->p_job,
|
||||||
pw->p_pid,pw->p_pgrp,job.savesig,join);
|
pw->p_pid,pw->p_pgrp,job.savesig,join);
|
||||||
sfsync(sfstderr);
|
sfsync(sfstderr);
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
|
@ -1328,7 +1328,7 @@ int job_post(pid_t pid, pid_t join)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns a process structure give a process id
|
* Returns a process structure give a process ID
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static struct process *job_bypid(pid_t pid)
|
static struct process *job_bypid(pid_t pid)
|
||||||
|
@ -1344,7 +1344,7 @@ static struct process *job_bypid(pid_t pid)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* return a pointer to a job given the job id
|
* return a pointer to a job given the job ID
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static struct process *job_byjid(int jobid)
|
static struct process *job_byjid(int jobid)
|
||||||
|
@ -1380,7 +1380,7 @@ static void job_prmsg(register struct process *pw)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Wait for process pid to complete
|
* Wait for process to complete
|
||||||
* If pid < -1, then wait can be interrupted, -pid is waited for (wait builtin)
|
* If pid < -1, then wait can be interrupted, -pid is waited for (wait builtin)
|
||||||
* pid=0 to unpost all done processes
|
* pid=0 to unpost all done processes
|
||||||
* pid=1 to wait for at least one process to complete
|
* pid=1 to wait for at least one process to complete
|
||||||
|
@ -1438,9 +1438,9 @@ int job_wait(register pid_t pid)
|
||||||
}
|
}
|
||||||
pwfg = pw;
|
pwfg = pw;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
sfprintf(sfstderr,"ksh: job line %4d: wait pid=%d critical=%d job=%d pid=%d\n",__LINE__,sh.current_pid,job.in_critical,jobid,pid);
|
sfprintf(sfstderr,"ksh: job line %4d: wait PID=%d critical=%d job=%d PID=%d\n",__LINE__,sh.current_pid,job.in_critical,jobid,pid);
|
||||||
if(pw)
|
if(pw)
|
||||||
sfprintf(sfstderr,"ksh: job line %4d: wait pid=%d critical=%d flags=%o\n",__LINE__,sh.current_pid,job.in_critical,pw->p_flag);
|
sfprintf(sfstderr,"ksh: job line %4d: wait PID=%d critical=%d flags=%o\n",__LINE__,sh.current_pid,job.in_critical,pw->p_flag);
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
errno = 0;
|
errno = 0;
|
||||||
if(sh.coutpipe>=0 && lastpid && sh.cpid==lastpid)
|
if(sh.coutpipe>=0 && lastpid && sh.cpid==lastpid)
|
||||||
|
@ -1695,7 +1695,7 @@ static struct process *job_unpost(register struct process *pwtop,int notify)
|
||||||
register struct process *pw;
|
register struct process *pw;
|
||||||
/* make sure all processes are done */
|
/* make sure all processes are done */
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
sfprintf(sfstderr,"ksh: job line %4d: drop pid=%d critical=%d pid=%d env=%u\n",__LINE__,sh.current_pid,job.in_critical,pwtop->p_pid,pwtop->p_env);
|
sfprintf(sfstderr,"ksh: job line %4d: drop PID=%d critical=%d PID=%d env=%u\n",__LINE__,sh.current_pid,job.in_critical,pwtop->p_pid,pwtop->p_env);
|
||||||
sfsync(sfstderr);
|
sfsync(sfstderr);
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
pwtop = pw = job_byjid((int)pwtop->p_job);
|
pwtop = pw = job_byjid((int)pwtop->p_job);
|
||||||
|
@ -1736,7 +1736,7 @@ static struct process *job_unpost(register struct process *pwtop,int notify)
|
||||||
}
|
}
|
||||||
pwtop->p_pid = 0;
|
pwtop->p_pid = 0;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
sfprintf(sfstderr,"ksh: job line %4d: free pid=%d critical=%d job=%d\n",__LINE__,sh.current_pid,job.in_critical,pwtop->p_job);
|
sfprintf(sfstderr,"ksh: job line %4d: free PID=%d critical=%d job=%d\n",__LINE__,sh.current_pid,job.in_critical,pwtop->p_job);
|
||||||
sfsync(sfstderr);
|
sfsync(sfstderr);
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
job_free((int)pwtop->p_job);
|
job_free((int)pwtop->p_job);
|
||||||
|
@ -1939,7 +1939,7 @@ int sh_waitsafe(void)
|
||||||
void job_fork(pid_t parent)
|
void job_fork(pid_t parent)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
sfprintf(sfstderr,"ksh: job line %4d: fork pid=%d critical=%d parent=%d\n",__LINE__,sh.current_pid,job.in_critical,parent);
|
sfprintf(sfstderr,"ksh: job line %4d: fork PID=%d critical=%d parent=%d\n",__LINE__,sh.current_pid,job.in_critical,parent);
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
switch (parent)
|
switch (parent)
|
||||||
{
|
{
|
||||||
|
|
|
@ -556,7 +556,7 @@ char *path_basename(register const char *name)
|
||||||
|
|
||||||
char *path_fullname(const char *name)
|
char *path_fullname(const char *name)
|
||||||
{
|
{
|
||||||
int len=strlen(name)+1,dirlen=0;
|
size_t len=strlen(name)+1,dirlen=0;
|
||||||
char *path,*pwd;
|
char *path,*pwd;
|
||||||
if(*name!='/')
|
if(*name!='/')
|
||||||
{
|
{
|
||||||
|
@ -1356,7 +1356,7 @@ static noreturn void exscript(register char *path,register char *argv[],char **e
|
||||||
if((euserid=geteuid()) != sh.userid)
|
if((euserid=geteuid()) != sh.userid)
|
||||||
{
|
{
|
||||||
strncpy(name+9,fmtbase((long)sh.current_pid,10,0),sizeof(name)-10);
|
strncpy(name+9,fmtbase((long)sh.current_pid,10,0),sizeof(name)-10);
|
||||||
/* create a suid open file with owner equal effective uid */
|
/* create an SUID open file with owner equal to effective UID */
|
||||||
if((n=open(name,O_CREAT|O_TRUNC|O_WRONLY,S_ISUID|S_IXUSR)) < 0)
|
if((n=open(name,O_CREAT|O_TRUNC|O_WRONLY,S_ISUID|S_IXUSR)) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
unlink(name);
|
unlink(name);
|
||||||
|
|
|
@ -76,7 +76,7 @@ static struct subshell
|
||||||
Dt_t *strack;/* tracked alias scope for subshell */
|
Dt_t *strack;/* tracked alias scope for subshell */
|
||||||
Pathcomp_t *pathlist; /* for PATH variable */
|
Pathcomp_t *pathlist; /* for PATH variable */
|
||||||
Shopt_t options;/* save shell options */
|
Shopt_t options;/* save shell options */
|
||||||
pid_t subpid; /* child process id */
|
pid_t subpid; /* child process ID */
|
||||||
Sfio_t* saveout;/* saved standard output */
|
Sfio_t* saveout;/* saved standard output */
|
||||||
char *pwd; /* present working directory */
|
char *pwd; /* present working directory */
|
||||||
void *jobs; /* save job info */
|
void *jobs; /* save job info */
|
||||||
|
|
|
@ -19,9 +19,9 @@
|
||||||
* *
|
* *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
/*
|
/*
|
||||||
* This is a program to execute 'execute only' and suid/sgid shell scripts.
|
* This is a program to execute 'execute only' and SUID/SGID shell scripts.
|
||||||
* This program must be owned by root and must have the set uid bit set.
|
* This program must be owned by root and must have the setuid bit set.
|
||||||
* It must not have the set group id bit set. This program must be installed
|
* It must not have the set group ID bit set. This program must be installed
|
||||||
* where the define parameter THISPROG indicates to work correctly on System V.
|
* where the define parameter THISPROG indicates to work correctly on System V.
|
||||||
*
|
*
|
||||||
* Written by David Korn
|
* Written by David Korn
|
||||||
|
@ -32,14 +32,14 @@
|
||||||
/* The file name of the script to execute is argv[0]
|
/* The file name of the script to execute is argv[0]
|
||||||
* argv[1] is the program name
|
* argv[1] is the program name
|
||||||
* The basic idea is to open the script as standard input, set the effective
|
* The basic idea is to open the script as standard input, set the effective
|
||||||
* user and group id correctly, and then exec the shell.
|
* user and group ID correctly, and then exec the shell.
|
||||||
* The complicated part is getting the effective uid of the caller and
|
* The complicated part is getting the effective UID of the caller and
|
||||||
* setting the effective uid/gid. The program which execs this program
|
* setting the effective UID/GID. The program which execs this program
|
||||||
* may pass file descriptor FDIN as an open file with mode SPECIAL if
|
* may pass file descriptor FDIN as an open file with mode SPECIAL if
|
||||||
* the effective user id is not the real user id. The effective
|
* the effective user ID is not the real user ID. The effective
|
||||||
* user id for authentication purposes will be the owner of this
|
* user ID for authentication purposes will be the owner of this
|
||||||
* open file. On systems without the setreuid() call, e[ug]id is set
|
* open file. On systems without the setreuid() call, e[ug]id is set
|
||||||
* by copying this program to a /tmp/file, making it a suid and/or sgid
|
* by copying this program to a /tmp/file, making it an SUID and/or SGID
|
||||||
* program, and then execing this program.
|
* program, and then execing this program.
|
||||||
* A forked version of this program waits until it can unlink the /tmp
|
* A forked version of this program waits until it can unlink the /tmp
|
||||||
* file and then exits. Actually, we fork() twice so the parent can
|
* file and then exits. Actually, we fork() twice so the parent can
|
||||||
|
@ -207,7 +207,7 @@ int main(int argc,char *argv[])
|
||||||
error_exit(badexec);
|
error_exit(badexec);
|
||||||
close(n);
|
close(n);
|
||||||
|
|
||||||
/* compute the desired new effective user and group id */
|
/* compute the desired new effective user and group ID */
|
||||||
effuid = euserid;
|
effuid = euserid;
|
||||||
effgid = egroupid;
|
effgid = egroupid;
|
||||||
mode = 0;
|
mode = 0;
|
||||||
|
@ -221,7 +221,7 @@ int main(int argc,char *argv[])
|
||||||
if(effgid != rgroupid || setgid(rgroupid) < 0)
|
if(effgid != rgroupid || setgid(rgroupid) < 0)
|
||||||
mode = S_ISGID;
|
mode = S_ISGID;
|
||||||
|
|
||||||
/* now see if the uid needs setting */
|
/* now see if the UID needs setting */
|
||||||
if(mode)
|
if(mode)
|
||||||
{
|
{
|
||||||
if(effuid != ruserid)
|
if(effuid != ruserid)
|
||||||
|
@ -296,7 +296,7 @@ static void error_exit(const char *message)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This version of access checks against effective uid and effective gid
|
* This version of access checks against effective UID and effective GID
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int eaccess(register const char *name, register int mode)
|
int eaccess(register const char *name, register int mode)
|
||||||
|
@ -360,7 +360,7 @@ static void setids(int mode,int owner,int group)
|
||||||
if(mode & S_ISGID)
|
if(mode & S_ISGID)
|
||||||
setregid(rgroupid,group);
|
setregid(rgroupid,group);
|
||||||
|
|
||||||
/* set effective uid even if S_ISUID is not set. This is because
|
/* set effective UID even if S_ISUID is not set. This is because
|
||||||
* we are *really* executing EUID root at this point. Even if S_ISUID
|
* we are *really* executing EUID root at this point. Even if S_ISUID
|
||||||
* is not set, the value for owner that is passed should be correct.
|
* is not set, the value for owner that is passed should be correct.
|
||||||
*/
|
*/
|
||||||
|
@ -370,7 +370,7 @@ static void setids(int mode,int owner,int group)
|
||||||
#else
|
#else
|
||||||
/*
|
/*
|
||||||
* This version of setids creates a /tmp file and copies itself into it.
|
* This version of setids creates a /tmp file and copies itself into it.
|
||||||
* The "clone" file is made executable with appropriate suid/sgid bits.
|
* The "clone" file is made executable with appropriate SUID/SGID bits.
|
||||||
* Finally, the clone is exec'd. This file is unlinked by a grandchild
|
* Finally, the clone is exec'd. This file is unlinked by a grandchild
|
||||||
* of this program, who waits around until the text is free.
|
* of this program, who waits around until the text is free.
|
||||||
*/
|
*/
|
||||||
|
@ -383,7 +383,7 @@ static void setids(int mode,uid_t owner,gid_t group)
|
||||||
/*
|
/*
|
||||||
* Create a token to pass to the new program for validation.
|
* Create a token to pass to the new program for validation.
|
||||||
* This token can only be procured by someone running with an
|
* This token can only be procured by someone running with an
|
||||||
* effective userid of root, and hence gives the clone a way to
|
* effective user ID of root, and hence gives the clone a way to
|
||||||
* certify that it was really invoked by THISPROG. Someone who
|
* certify that it was really invoked by THISPROG. Someone who
|
||||||
* is already root could spoof us, but why would they want to?
|
* is already root could spoof us, but why would they want to?
|
||||||
*
|
*
|
||||||
|
@ -492,7 +492,7 @@ static void maketemp(char *template)
|
||||||
register pid_t n = getpid();
|
register pid_t n = getpid();
|
||||||
/* skip to end of string */
|
/* skip to end of string */
|
||||||
while(*++cp);
|
while(*++cp);
|
||||||
/* convert process id to string */
|
/* convert process ID to string */
|
||||||
while(n > 0)
|
while(n > 0)
|
||||||
{
|
{
|
||||||
*--cp = (n%10) + '0';
|
*--cp = (n%10) + '0';
|
||||||
|
|
|
@ -2902,7 +2902,7 @@ pid_t _sh_fork(register pid_t parent,int flags,int *jobid)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* errno==EPERM means that an earlier processes
|
* errno==EPERM means that an earlier processes
|
||||||
* completed. Make parent the job group id.
|
* completed. Make parent the job group ID.
|
||||||
*/
|
*/
|
||||||
if(postid==0)
|
if(postid==0)
|
||||||
job.curpgid = parent;
|
job.curpgid = parent;
|
||||||
|
|
|
@ -172,7 +172,7 @@ of type \f3Shbltin_t\fP. This structure contains \f3shp\fP which is a pointer
|
||||||
to the shell interpreter, and \f3ptr\fP which is a pointer that
|
to the shell interpreter, and \f3ptr\fP which is a pointer that
|
||||||
can be associated with each built-in.
|
can be associated with each built-in.
|
||||||
The \f3sh_addbuiltin()\fP function is used to add, replace or delete
|
The \f3sh_addbuiltin()\fP function is used to add, replace or delete
|
||||||
built-in commands.
|
built-in commands.
|
||||||
It takes the name of the built-in, \fIname\fP, a pointer
|
It takes the name of the built-in, \fIname\fP, a pointer
|
||||||
to the function that implements the built-in, \fIfn\fP, and
|
to the function that implements the built-in, \fIfn\fP, and
|
||||||
a pointer that will be passed to the function in the \f3ptr\fP field when
|
a pointer that will be passed to the function in the \f3ptr\fP field when
|
||||||
|
@ -253,9 +253,9 @@ Cause the shell to fail with an error of an unset variable is
|
||||||
referenced.
|
referenced.
|
||||||
.IP
|
.IP
|
||||||
\f3SH_PRIVILEGED\fP:
|
\f3SH_PRIVILEGED\fP:
|
||||||
This mode is on whenever the effective uid (gid) is not equal to the real
|
This mode is on whenever the effective UID (GID) is not equal to the real
|
||||||
uid (gid). Turning this off causes the effective uid and gid to be set to
|
UID (GID). Turning this off causes the effective UID and GID to be set to
|
||||||
the real uid and gid.
|
the real UID and GID.
|
||||||
.IP
|
.IP
|
||||||
\f3SH_VERBOSE\fP:
|
\f3SH_VERBOSE\fP:
|
||||||
Cause each line to be echoed as it is read by the parser.
|
Cause each line to be echoed as it is read by the parser.
|
||||||
|
@ -270,7 +270,6 @@ The vi edit mode.
|
||||||
\f3SH_VIRAW\fP:
|
\f3SH_VIRAW\fP:
|
||||||
Read character at a time rather than line at a time when
|
Read character at a time rather than line at a time when
|
||||||
in vi edit mode.
|
in vi edit mode.
|
||||||
.IP
|
|
||||||
.PP
|
.PP
|
||||||
The \f3sh_trap()\fP function can be used to compile and execute
|
The \f3sh_trap()\fP function can be used to compile and execute
|
||||||
a string or file.
|
a string or file.
|
||||||
|
@ -289,10 +288,10 @@ The return value of \f3sh_trap()\fP is the exit status of
|
||||||
the last command executed by the string or file.
|
the last command executed by the string or file.
|
||||||
.PP
|
.PP
|
||||||
The \f3sh_run()\fP function will run the command given by
|
The \f3sh_run()\fP function will run the command given by
|
||||||
by the argument list \fIargv\fP containing \fIargc\fP elements.
|
by the argument list \fIargv\fP containing \fIargc\fP elements.
|
||||||
If \fIargv\fP\f3[0]\fP does not contain a \f3/\fP, it will
|
If \fIargv\fP\f3[0]\fP does not contain a \f3/\fP, it will
|
||||||
be checked to see if it is a built-in or function before
|
be checked to see if it is a built-in or function before
|
||||||
performing a path search.
|
performing a path search.
|
||||||
.PP
|
.PP
|
||||||
The \f3sh_eval()\fP function executes a string or file
|
The \f3sh_eval()\fP function executes a string or file
|
||||||
stream \fIsp\fP.
|
stream \fIsp\fP.
|
||||||
|
@ -348,13 +347,13 @@ as arguments.
|
||||||
.PP
|
.PP
|
||||||
The \f3sh_fun()\fP function can be called within a
|
The \f3sh_fun()\fP function can be called within a
|
||||||
discipline function or built-in extension to execute a
|
discipline function or built-in extension to execute a
|
||||||
discipline function script.
|
discipline function script.
|
||||||
The argument \fIfunnode\fP is a pointer to the shell function
|
The argument \fIfunnode\fP is a pointer to the shell function
|
||||||
or built-in to execute.
|
or built-in to execute.
|
||||||
The argument \fIvarnode\fP is a pointer to the name
|
The argument \fIvarnode\fP is a pointer to the name
|
||||||
value pair that has defined this discipline.
|
value pair that has defined this discipline.
|
||||||
The array \fIargv\fP is a \f3NULL\fP terminated list of
|
The array \fIargv\fP is a \f3NULL\fP terminated list of
|
||||||
arguments that are passed to the function.
|
arguments that are passed to the function.
|
||||||
.PP
|
.PP
|
||||||
By default, \f3ksh\fP only records but does not act
|
By default, \f3ksh\fP only records but does not act
|
||||||
on signals when running a built-in command.
|
on signals when running a built-in command.
|
||||||
|
@ -401,7 +400,7 @@ The second is a timeout in milliseconds.
|
||||||
A value of \f3\-1\fP for the timeout means that
|
A value of \f3\-1\fP for the timeout means that
|
||||||
no timeout should be set.
|
no timeout should be set.
|
||||||
The third argument is 0 for input file descriptors
|
The third argument is 0 for input file descriptors
|
||||||
and 1 for output file descriptor.
|
and 1 for output file descriptor.
|
||||||
The function needs to return a value \f3>0\fP if there
|
The function needs to return a value \f3>0\fP if there
|
||||||
is input on the file descriptor, and a value \f3<0\fP
|
is input on the file descriptor, and a value \f3<0\fP
|
||||||
if the timeout is reached or a signal has occurred.
|
if the timeout is reached or a signal has occurred.
|
||||||
|
|
|
@ -598,7 +598,7 @@ x=$(
|
||||||
foo[1]=(66)
|
foo[1]=(66)
|
||||||
typeset -p foo
|
typeset -p foo
|
||||||
) 2> /dev/null
|
) 2> /dev/null
|
||||||
[[ $x == "$exp" ]] || err_exit 'setting element 1 to index fooay failed'
|
[[ $x == "$exp" ]] || err_exit 'setting element 1 of indexed array foo failed'
|
||||||
unset foo
|
unset foo
|
||||||
exp='typeset -a foo=((11 22) (x=3))'
|
exp='typeset -a foo=((11 22) (x=3))'
|
||||||
x=$(
|
x=$(
|
||||||
|
|
|
@ -536,7 +536,7 @@ if builtin cat 2> /dev/null; then
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$SHELL -c 'kill -0 123456789123456789123456789' 2> /dev/null && err_exit 'kill not catching process id overflows'
|
$SHELL -c 'kill -0 123456789123456789123456789' 2> /dev/null && err_exit 'kill not catching process ID overflows'
|
||||||
|
|
||||||
[[ $($SHELL -c '{ cd..; print ok;}' 2> /dev/null) == ok ]] || err_exit 'command name ending in .. causes shell to abort'
|
[[ $($SHELL -c '{ cd..; print ok;}' 2> /dev/null) == ok ]] || err_exit 'command name ending in .. causes shell to abort'
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ fi
|
||||||
|
|
||||||
bintrue=$(whence -p true)
|
bintrue=$(whence -p true)
|
||||||
|
|
||||||
function ping # id
|
function ping # ID
|
||||||
{
|
{
|
||||||
integer x=0
|
integer x=0
|
||||||
while ((x++ < 5))
|
while ((x++ < 5))
|
||||||
|
|
|
@ -1042,7 +1042,7 @@ function foo
|
||||||
typeset pid
|
typeset pid
|
||||||
$tmp1 > $tmp2 & pid=$!
|
$tmp1 > $tmp2 & pid=$!
|
||||||
wait $!
|
wait $!
|
||||||
[[ $(< $tmp2) == $pid ]] || err_exit 'wrong pid for & job in function'
|
[[ $(< $tmp2) == $pid ]] || err_exit 'wrong PID for & job in function'
|
||||||
}
|
}
|
||||||
foo
|
foo
|
||||||
# make sure compiled functions work
|
# make sure compiled functions work
|
||||||
|
|
|
@ -50,7 +50,7 @@ function grep
|
||||||
done
|
done
|
||||||
noprint=$vflag$cflag$lflag # don't print if these flags are set
|
noprint=$vflag$cflag$lflag # don't print if these flags are set
|
||||||
integer n=0 c=0 tc=0 nargs=$# # initialize counters
|
integer n=0 c=0 tc=0 nargs=$# # initialize counters
|
||||||
for i in "$@" # go thru the files
|
for i in "$@" # go through the files
|
||||||
do if ((nargs<=1))
|
do if ((nargs<=1))
|
||||||
then fname=''
|
then fname=''
|
||||||
else fname="$i":
|
else fname="$i":
|
||||||
|
|
|
@ -126,7 +126,7 @@ then err_exit "CHLD trap failed -- expected 4 args, got $#"
|
||||||
elif (( $4 != 0 ))
|
elif (( $4 != 0 ))
|
||||||
then err_exit "CHLD trap failed -- exit code $4"
|
then err_exit "CHLD trap failed -- exit code $4"
|
||||||
elif (( $1 != $2 ))
|
elif (( $1 != $2 ))
|
||||||
then err_exit "child pid mismatch -- got '$1' != '$2'"
|
then err_exit "child PID mismatch -- got '$1' != '$2'"
|
||||||
elif (( $3 != 9 ))
|
elif (( $3 != 9 ))
|
||||||
then err_exit "child status mismatch -- expected '9', got '$3'"
|
then err_exit "child status mismatch -- expected '9', got '$3'"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -27,7 +27,7 @@ then x=$(print -r -- ~root)
|
||||||
[[ $x == ~root ]] || err_exit '~user expanded in subshell prevent ~user from working'
|
[[ $x == ~root ]] || err_exit '~user expanded in subshell prevent ~user from working'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function home # id
|
function home # ID
|
||||||
{
|
{
|
||||||
typeset IFS=: pwd=/etc/passwd
|
typeset IFS=: pwd=/etc/passwd
|
||||||
set -o noglob
|
set -o noglob
|
||||||
|
|
|
@ -83,7 +83,7 @@ string:
|
||||||
strls ls -l format support
|
strls ls -l format support
|
||||||
strmatch Korn shell file pattern match
|
strmatch Korn shell file pattern match
|
||||||
strmode return ls -l style output given st.st_mode
|
strmode return ls -l style output given st.st_mode
|
||||||
strsignal return signal id string given SIG* number
|
strsignal return signal ID string given SIG* number
|
||||||
strtape convert generic tape unit to /dev/* file
|
strtape convert generic tape unit to /dev/* file
|
||||||
token generate space separated tokens in string
|
token generate space separated tokens in string
|
||||||
|
|
||||||
|
|
|
@ -223,7 +223,7 @@
|
||||||
09-12-04 features/options: add "opt map-libc" check
|
09-12-04 features/options: add "opt map-libc" check
|
||||||
09-12-03 tm/tmxdate.c: fix 'next month final day' for dec -> jan
|
09-12-03 tm/tmxdate.c: fix 'next month final day' for dec -> jan
|
||||||
09-11-21 misc/magic.tab: add gimp XCF
|
09-11-21 misc/magic.tab: add gimp XCF
|
||||||
09-11-20 vmalloc/vmtrace.c: add pid to assertion diagnostics
|
09-11-20 vmalloc/vmtrace.c: add PID to assertion diagnostics
|
||||||
09-11-11 regex.h,regcomp.c: add REG_CLASS_ESCAPE, \ inside [...] literal by default
|
09-11-11 regex.h,regcomp.c: add REG_CLASS_ESCAPE, \ inside [...] literal by default
|
||||||
09-11-03 regex/regcache.c: change to variable length pattern strings
|
09-11-03 regex/regcache.c: change to variable length pattern strings
|
||||||
09-10-28 include/error.h: fix ERROR_translate() arg parens
|
09-10-28 include/error.h: fix ERROR_translate() arg parens
|
||||||
|
@ -1300,7 +1300,7 @@
|
||||||
astgetconf: add for thread safe error message control
|
astgetconf: add for thread safe error message control
|
||||||
astlicense: fix type=special but with non-null notice
|
astlicense: fix type=special but with non-null notice
|
||||||
errorx: add for ERROR_translate() support
|
errorx: add for ERROR_translate() support
|
||||||
ERROR_translate: add locale id args for alternate dictionary
|
ERROR_translate: add locale ID args for alternate dictionary
|
||||||
option.h: move _OPT_PRIVATE_ to pointer to avoid dll size mismatch
|
option.h: move _OPT_PRIVATE_ to pointer to avoid dll size mismatch
|
||||||
ftwalk: fix FTW_CHILDREN bug that hit top level non-dirs twice
|
ftwalk: fix FTW_CHILDREN bug that hit top level non-dirs twice
|
||||||
translate.c: default error_info.translate
|
translate.c: default error_info.translate
|
||||||
|
@ -1310,7 +1310,7 @@
|
||||||
00-03-07 optget: fix numeric option support test
|
00-03-07 optget: fix numeric option support test
|
||||||
sfkeyprintf: add %q for '...' quoting with ANSI escapes
|
sfkeyprintf: add %q for '...' quoting with ANSI escapes
|
||||||
00-03-06 features/stdio: fix _sfflsbuf prototype (dingold@gte.net)
|
00-03-06 features/stdio: fix _sfflsbuf prototype (dingold@gte.net)
|
||||||
00-02-14 pathtmp: fix pid cache bug that sometimes repeated after ~10 attempts
|
00-02-14 pathtmp: fix PID cache bug that sometimes repeated after ~10 attempts
|
||||||
optget: "..." attribute quote
|
optget: "..." attribute quote
|
||||||
pathfind: eliminate *: prefix in lib, not type
|
pathfind: eliminate *: prefix in lib, not type
|
||||||
proc: PROC_FOREGROUND for system(3) semantics (wait status return)
|
proc: PROC_FOREGROUND for system(3) semantics (wait status return)
|
||||||
|
@ -1372,7 +1372,7 @@
|
||||||
99-05-21 tm*: add TM_WINDOW==69 for consistent century windowing guard year
|
99-05-21 tm*: add TM_WINDOW==69 for consistent century windowing guard year
|
||||||
99-05-18 tmtime: add century leap year calc anticipating unsigned time_t
|
99-05-18 tmtime: add century leap year calc anticipating unsigned time_t
|
||||||
99-05-17 sfkeyprintf: handle %o and %x!!
|
99-05-17 sfkeyprintf: handle %o and %x!!
|
||||||
99-05-09 pathprobe: $HOME/.probe if not suid and st_uid!=geteuid()
|
99-05-09 pathprobe: $HOME/.probe if not SUID and st_uid!=geteuid()
|
||||||
99-04-28 magic,magic.tab: add registry()
|
99-04-28 magic,magic.tab: add registry()
|
||||||
99-04-24 regcomp: fix ksh pattern +! parse
|
99-04-24 regcomp: fix ksh pattern +! parse
|
||||||
regfatalpat: add
|
regfatalpat: add
|
||||||
|
@ -1430,7 +1430,7 @@
|
||||||
98-06-01 disc/sf*.c: memset(0) after disc malloc()
|
98-06-01 disc/sf*.c: memset(0) after disc malloc()
|
||||||
98-05-11 strelapsed: y==Y
|
98-05-11 strelapsed: y==Y
|
||||||
fts: pathcanon() top list
|
fts: pathcanon() top list
|
||||||
98-04-01 error: error_info.time for all msgs, just after cmd id
|
98-04-01 error: error_info.time for all msgs, just after cmd ID
|
||||||
error: no sfsync(sfstdin)
|
error: no sfsync(sfstdin)
|
||||||
sfio: sfpool, Sffmt_t update
|
sfio: sfpool, Sffmt_t update
|
||||||
magic.tab: SGI core dumps -- why aren't these ELF?
|
magic.tab: SGI core dumps -- why aren't these ELF?
|
||||||
|
@ -1486,7 +1486,7 @@
|
||||||
sfio: update including SF_WHOLE
|
sfio: update including SF_WHOLE
|
||||||
97-10-01 sfdostext: add \r\n => \n sfio discipline
|
97-10-01 sfdostext: add \r\n => \n sfio discipline
|
||||||
stropt: NiL table => p=name for all name=value
|
stropt: NiL table => p=name for all name=value
|
||||||
97-08-11 pathtmp: check pid to note forks
|
97-08-11 pathtmp: check PID to note forks
|
||||||
procopen: FD_CLOEXEC rfd && wfd
|
procopen: FD_CLOEXEC rfd && wfd
|
||||||
fts: fts_close() after fts_children() with no fts_read() now works
|
fts: fts_close() after fts_children() with no fts_read() now works
|
||||||
97-07-17 error: sfsync(sfstdin,sfstdout,sfstderr) instead of sfsync(NiL)
|
97-07-17 error: sfsync(sfstdin,sfstdout,sfstderr) instead of sfsync(NiL)
|
||||||
|
|
|
@ -66,7 +66,7 @@ aso_init_semaphore(void* data, const char* details)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* semaphore 0 is the reference count
|
* semaphore 0 is the reference count
|
||||||
* the id is dropped on last reference
|
* the ID is dropped on last reference
|
||||||
*/
|
*/
|
||||||
|
|
||||||
sem.sem_num = 0;
|
sem.sem_num = 0;
|
||||||
|
|
|
@ -47,7 +47,7 @@ typedef struct Optdisc_s
|
||||||
{
|
{
|
||||||
unsigned long version; /* OPT_VERSION */
|
unsigned long version; /* OPT_VERSION */
|
||||||
unsigned long flags; /* OPT_* flags */
|
unsigned long flags; /* OPT_* flags */
|
||||||
char* catalog; /* error catalog id */
|
char* catalog; /* error catalog ID */
|
||||||
Optinfo_f infof; /* runtime info function */
|
Optinfo_f infof; /* runtime info function */
|
||||||
} Optdisc_t;
|
} Optdisc_t;
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
* *
|
* *
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
/*
|
/*
|
||||||
* access() euid/egid implementation
|
* access() EUID/EGID implementation
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <ast.h>
|
#include <ast.h>
|
||||||
|
|
|
@ -464,7 +464,7 @@ runve(int mode, const char* path, char* const* argv, char* const* envv)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* 2004-02-29 Cygwin _P_DETACH is useless:
|
* 2004-02-29 Cygwin _P_DETACH is useless:
|
||||||
* spawn*() returns 0 instead of the spawned pid
|
* spawn*() returns 0 instead of the spawned PID
|
||||||
* spawned { pgid sid } are the same as the parent
|
* spawned { pgid sid } are the same as the parent
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ native_locale(const char* locale, char* buf, size_t siz)
|
||||||
const Lc_attribute_list_t* ap;
|
const Lc_attribute_list_t* ap;
|
||||||
int i;
|
int i;
|
||||||
unsigned long lcid;
|
unsigned long lcid;
|
||||||
unsigned long lang;
|
unsigned long langidx;
|
||||||
unsigned long ctry;
|
unsigned long ctry;
|
||||||
char lbuf[128];
|
char lbuf[128];
|
||||||
char cbuf[128];
|
char cbuf[128];
|
||||||
|
@ -113,7 +113,7 @@ native_locale(const char* locale, char* buf, size_t siz)
|
||||||
{
|
{
|
||||||
if (!(lc = lcmake(locale)))
|
if (!(lc = lcmake(locale)))
|
||||||
return 0;
|
return 0;
|
||||||
lang = lc->language->index;
|
langidx = lc->language->index;
|
||||||
ctry = 0;
|
ctry = 0;
|
||||||
for (ap = lc->attributes; ap; ap = ap->next)
|
for (ap = lc->attributes; ap; ap = ap->next)
|
||||||
if (ctry = ap->attribute->index)
|
if (ctry = ap->attribute->index)
|
||||||
|
@ -128,12 +128,12 @@ native_locale(const char* locale, char* buf, size_t siz)
|
||||||
}
|
}
|
||||||
if (!ctry)
|
if (!ctry)
|
||||||
{
|
{
|
||||||
if (!lang)
|
if (!langidx)
|
||||||
return 0;
|
return 0;
|
||||||
ctry = SUBLANG_DEFAULT;
|
ctry = SUBLANG_DEFAULT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lcid = MAKELCID(MAKELANGID(lang, ctry), SORT_DEFAULT);
|
lcid = MAKELCID(MAKELANGID(langidx, ctry), SORT_DEFAULT);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
lcid = GetUserDefaultLCID();
|
lcid = GetUserDefaultLCID();
|
||||||
|
|
|
@ -51,7 +51,7 @@ extern int setpgrp(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* set process group id
|
* set process group ID
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -83,7 +83,7 @@
|
||||||
|
|
||||||
/* openlog flags */
|
/* openlog flags */
|
||||||
|
|
||||||
#define LOG_PID 0x01 /* log the pid with each message */
|
#define LOG_PID 0x01 /* log the PID with each message */
|
||||||
#define LOG_CONS 0x02 /* log to console if errors in sending */
|
#define LOG_CONS 0x02 /* log to console if errors in sending */
|
||||||
#define LOG_NDELAY 0x08 /* open right now */
|
#define LOG_NDELAY 0x08 /* open right now */
|
||||||
#define LOG_ODELAY 0x04 /* delay open until syslog() is called */
|
#define LOG_ODELAY 0x04 /* delay open until syslog() is called */
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
/*
|
/*
|
||||||
* POSIX waitpid()
|
* POSIX waitpid()
|
||||||
*
|
*
|
||||||
* pid < -1 WUNTRACED may not be fully supported
|
* PID < -1 WUNTRACED may not be fully supported
|
||||||
* process group specifics ignored by non-{waitpid,wait4}
|
* process group specifics ignored by non-{waitpid,wait4}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -196,7 +196,7 @@ cat{
|
||||||
unsigned long f_files; /* total # of file nodes (inodes) */
|
unsigned long f_files; /* total # of file nodes (inodes) */
|
||||||
unsigned long f_ffree; /* total # of free file nodes */
|
unsigned long f_ffree; /* total # of free file nodes */
|
||||||
unsigned long f_favail; /* # of free nodes avail to non-superuser */
|
unsigned long f_favail; /* # of free nodes avail to non-superuser */
|
||||||
unsigned long f_fsid; /* file system id (dev for now) */
|
unsigned long f_fsid; /* file system ID (dev for now) */
|
||||||
char f_basetype[16]; /* target fs type name, null-terminated */
|
char f_basetype[16]; /* target fs type name, null-terminated */
|
||||||
unsigned long f_flag; /* bit-mask of flags */
|
unsigned long f_flag; /* bit-mask of flags */
|
||||||
unsigned long f_namemax; /* maximum file name length */
|
unsigned long f_namemax; /* maximum file name length */
|
||||||
|
|
|
@ -66,7 +66,7 @@ struct Cmddisc_s
|
||||||
|
|
||||||
typedef struct Cmdarg_s /* cmdopen() handle */
|
typedef struct Cmdarg_s /* cmdopen() handle */
|
||||||
{
|
{
|
||||||
const char* id; /* library id string */
|
const char* id; /* library ID string */
|
||||||
|
|
||||||
#ifdef _CMDARG_PRIVATE_
|
#ifdef _CMDARG_PRIVATE_
|
||||||
_CMDARG_PRIVATE_
|
_CMDARG_PRIVATE_
|
||||||
|
|
|
@ -112,7 +112,7 @@ typedef struct Error_context_s Error_context_t;
|
||||||
int line; /* input|output line number */ \
|
int line; /* input|output line number */ \
|
||||||
int warnings; /* ERROR_WARNING count */ \
|
int warnings; /* ERROR_WARNING count */ \
|
||||||
char* file; /* input|output file name */ \
|
char* file; /* input|output file name */ \
|
||||||
char* id; /* command id */
|
char* id; /* command ID */
|
||||||
|
|
||||||
struct Error_context_s /* context stack element */
|
struct Error_context_s /* context stack element */
|
||||||
{
|
{
|
||||||
|
|
|
@ -63,7 +63,7 @@ typedef struct Finddisc_s
|
||||||
|
|
||||||
typedef struct Find_s
|
typedef struct Find_s
|
||||||
{
|
{
|
||||||
const char* id; /* library id string */
|
const char* id; /* library ID string */
|
||||||
unsigned long stamp; /* codes time stamp */
|
unsigned long stamp; /* codes time stamp */
|
||||||
|
|
||||||
#ifdef _FIND_PRIVATE_
|
#ifdef _FIND_PRIVATE_
|
||||||
|
|
|
@ -63,7 +63,7 @@ typedef struct Magicdisc_s
|
||||||
|
|
||||||
typedef struct Magic_s
|
typedef struct Magic_s
|
||||||
{
|
{
|
||||||
const char* id; /* library id string */
|
const char* id; /* library ID string */
|
||||||
|
|
||||||
#ifdef _MAGIC_PRIVATE_
|
#ifdef _MAGIC_PRIVATE_
|
||||||
_MAGIC_PRIVATE_
|
_MAGIC_PRIVATE_
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* generic binary magic id definitions
|
* generic binary magic ID definitions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _MAGICID_H
|
#ifndef _MAGICID_H
|
||||||
|
|
|
@ -64,7 +64,7 @@ struct Mimedisc_s
|
||||||
|
|
||||||
struct Mime_s
|
struct Mime_s
|
||||||
{
|
{
|
||||||
const char* id; /* library id string */
|
const char* id; /* library ID string */
|
||||||
|
|
||||||
#ifdef _MIME_PRIVATE_
|
#ifdef _MIME_PRIVATE_
|
||||||
_MIME_PRIVATE_
|
_MIME_PRIVATE_
|
||||||
|
|
|
@ -45,7 +45,7 @@ typedef struct Optdisc_s
|
||||||
{
|
{
|
||||||
unsigned long version; /* OPT_VERSION */
|
unsigned long version; /* OPT_VERSION */
|
||||||
unsigned long flags; /* OPT_* flags */
|
unsigned long flags; /* OPT_* flags */
|
||||||
char* catalog; /* error catalog id */
|
char* catalog; /* error catalog ID */
|
||||||
Optinfo_f infof; /* runtime info function */
|
Optinfo_f infof; /* runtime info function */
|
||||||
} Optdisc_t;
|
} Optdisc_t;
|
||||||
|
|
||||||
|
|
|
@ -83,8 +83,8 @@
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
pid_t pid; /* process id */
|
pid_t pid; /* process ID */
|
||||||
pid_t pgrp; /* process group id */
|
pid_t pgrp; /* process group ID */
|
||||||
int rfd; /* read fd if applicable */
|
int rfd; /* read fd if applicable */
|
||||||
int wfd; /* write fd if applicable */
|
int wfd; /* write fd if applicable */
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,7 @@
|
||||||
#define REG_ENULL 14 /* empty subexpr in pattern */
|
#define REG_ENULL 14 /* empty subexpr in pattern */
|
||||||
#define REG_ECOUNT 15 /* re component count overflow */
|
#define REG_ECOUNT 15 /* re component count overflow */
|
||||||
#define REG_BADESC 16 /* invalid \char escape */
|
#define REG_BADESC 16 /* invalid \char escape */
|
||||||
#define REG_VERSIONID 17 /* version id (pseudo error) */
|
#define REG_VERSIONID 17 /* version ID (pseudo error) */
|
||||||
#define REG_EFLAGS 18 /* flags conflict */
|
#define REG_EFLAGS 18 /* flags conflict */
|
||||||
#define REG_EDELIM 19 /* invalid or omitted delimiter */
|
#define REG_EDELIM 19 /* invalid or omitted delimiter */
|
||||||
#define REG_PANIC 20 /* unrecoverable internal error */
|
#define REG_PANIC 20 /* unrecoverable internal error */
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
struct _sfdisc_s* disc; /* discipline */ \
|
struct _sfdisc_s* disc; /* discipline */ \
|
||||||
struct _sfpool_s* pool; /* the pool containing this */ \
|
struct _sfpool_s* pool; /* the pool containing this */ \
|
||||||
struct _sfrsrv_s* rsrv; /* reserved buffer */ \
|
struct _sfrsrv_s* rsrv; /* reserved buffer */ \
|
||||||
struct _sfproc_s* proc; /* coprocess id, etc. */ \
|
struct _sfproc_s* proc; /* coprocess ID, etc. */ \
|
||||||
void* mutex; /* mutex for thread-safety */ \
|
void* mutex; /* mutex for thread-safety */ \
|
||||||
void* stdio; /* stdio FILE if any */ \
|
void* stdio; /* stdio FILE if any */ \
|
||||||
Sfoff_t lpos; /* last seek position */ \
|
Sfoff_t lpos; /* last seek position */ \
|
||||||
|
|
|
@ -71,8 +71,8 @@
|
||||||
* bits used in mode field
|
* bits used in mode field
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define TSUID 04000 /* set uid on exec */
|
#define TSUID 04000 /* setuid on exec */
|
||||||
#define TSGID 02000 /* set gid on exec */
|
#define TSGID 02000 /* setgid on exec */
|
||||||
#define TSVTX 01000 /* sticky bit -- reserved */
|
#define TSVTX 01000 /* sticky bit -- reserved */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -393,7 +393,7 @@ where the length of
|
||||||
.IR pfx ,
|
.IR pfx ,
|
||||||
if !=0, is limited to 5, the length of
|
if !=0, is limited to 5, the length of
|
||||||
.I <pid>
|
.I <pid>
|
||||||
(the base 64 representation of the current process id)
|
(the base 64 representation of the current process ID)
|
||||||
is limited to 3, and
|
is limited to 3, and
|
||||||
.I <suf>
|
.I <suf>
|
||||||
(an internally generated suffix that avoid file conflicts)
|
(an internally generated suffix that avoid file conflicts)
|
||||||
|
|
|
@ -206,7 +206,7 @@ The child environment is cleared before
|
||||||
is added.
|
is added.
|
||||||
.TP
|
.TP
|
||||||
.L PROC_GID
|
.L PROC_GID
|
||||||
The child effective group id is set to the real group id.
|
The child effective group ID is set to the real group ID.
|
||||||
.TP
|
.TP
|
||||||
.L PROC_IGNORE
|
.L PROC_IGNORE
|
||||||
Parent pipe errors are ignored.
|
Parent pipe errors are ignored.
|
||||||
|
@ -239,11 +239,11 @@ is used to execute
|
||||||
if it is a shell script.
|
if it is a shell script.
|
||||||
.TP
|
.TP
|
||||||
.L PROC_PRIVELEGED
|
.L PROC_PRIVELEGED
|
||||||
If the effective user id is
|
If the effective user ID is
|
||||||
.L 0
|
.L 0
|
||||||
then the child real user id is set to
|
then the child real user ID is set to
|
||||||
.L 0
|
.L 0
|
||||||
and the child real group id is set to the effective group id.
|
and the child real group ID is set to the effective group ID.
|
||||||
.TP
|
.TP
|
||||||
.L PROC_READ
|
.L PROC_READ
|
||||||
.I proc.rfd
|
.I proc.rfd
|
||||||
|
@ -259,7 +259,7 @@ entry
|
||||||
.LR PROC_SYS_PGRP(-1) .)
|
.LR PROC_SYS_PGRP(-1) .)
|
||||||
.TP
|
.TP
|
||||||
.L PROC_UID
|
.L PROC_UID
|
||||||
The child effective user id is set to the real user id.
|
The child effective user ID is set to the real user ID.
|
||||||
.TP
|
.TP
|
||||||
.L PROC_WRITE
|
.L PROC_WRITE
|
||||||
.I proc.wfd
|
.I proc.wfd
|
||||||
|
@ -270,7 +270,7 @@ standard input.
|
||||||
The return value is a pointer to a structure with the following members:
|
The return value is a pointer to a structure with the following members:
|
||||||
.TP
|
.TP
|
||||||
.L "pid_t \fIpid\fP"
|
.L "pid_t \fIpid\fP"
|
||||||
The child process id.
|
The child process ID.
|
||||||
.TP
|
.TP
|
||||||
.L "pid_t \fIpgrp\fP"
|
.L "pid_t \fIpgrp\fP"
|
||||||
The child process group.
|
The child process group.
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
.SH NAME
|
.SH NAME
|
||||||
strdup \- duplicate null-terminated string
|
strdup \- duplicate null-terminated string
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.L "char* strdup(char* s)"
|
.L "char* strdup(const char* s)"
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.I strdup
|
.I strdup
|
||||||
copies the null-terminated string
|
copies the null-terminated string
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
.SH NAME
|
.SH NAME
|
||||||
strelapsed \- parse elapsed time expression
|
strelapsed \- parse elapsed time expression
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.L "unsigned long strelapsed(char* buf, char** next, int persec)"
|
.L "unsigned long strelapsed(const char* buf, char** next, int persec)"
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.I strelapsed
|
.I strelapsed
|
||||||
returns a pointer to a string representation of the elapsed time for
|
returns a pointer to a string representation of the elapsed time for
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
.SH NAME
|
.SH NAME
|
||||||
streval \- long integer arithmetic expression evaluator
|
streval \- long integer arithmetic expression evaluator
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.L "long streval(char* s, char** e, long (*conv)(char* cs, char** ce))"
|
.L "long streval(const char* s, char** e, long (*conv)(const char* cs, char** ce))"
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.I streval
|
.I streval
|
||||||
evaluates the long integer arithmetic expression in the null-terminated string
|
evaluates the long integer arithmetic expression in the null-terminated string
|
||||||
|
|
|
@ -40,9 +40,9 @@
|
||||||
.SH NAME
|
.SH NAME
|
||||||
strmatch \- match shell file patterns
|
strmatch \- match shell file patterns
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.L "int strmatch(char* s, char* p)"
|
.L "int strmatch(const char* s, const char* p)"
|
||||||
.br
|
.br
|
||||||
.L "char* submatch(char* s, char* p, int m)"
|
.L "char* submatch(const char* s, const char* p, int flags)"
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.I strmatch
|
.I strmatch
|
||||||
compares the string
|
compares the string
|
||||||
|
@ -56,7 +56,7 @@ does a leading substring match of the shell pattern
|
||||||
with the string
|
with the string
|
||||||
.IR s .
|
.IR s .
|
||||||
If
|
If
|
||||||
.I m
|
.I flags
|
||||||
is 0 then the match is minimal, otherwise a maximal match is done.
|
is 0 then the match is minimal, otherwise a maximal match is done.
|
||||||
A pointer to the first character after the matched substring is returned,
|
A pointer to the first character after the matched substring is returned,
|
||||||
.I 0
|
.I 0
|
||||||
|
|
|
@ -42,7 +42,7 @@ stropt \- table driven option expression evaluator
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.L "#include <namval.h>"
|
.L "#include <namval.h>"
|
||||||
.br
|
.br
|
||||||
.L "int stropt(char* s, struct namval* tab,
|
.L "int stropt(const char* s, struct namval* tab, int siz,
|
||||||
.br
|
.br
|
||||||
.L " int (*fun)(void* a, struct namval* p, int n, char* v),"
|
.L " int (*fun)(void* a, struct namval* p, int n, char* v),"
|
||||||
.br
|
.br
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
.SH NAME
|
.SH NAME
|
||||||
strperm \- evaluate file permission expression
|
strperm \- evaluate file permission expression
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.L "int strperm(char* s, char** e, int p)"
|
.L "int strperm(const char* s, char** e, int p)"
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.I strperm
|
.I strperm
|
||||||
applies a file permission expression in the null-terminated string
|
applies a file permission expression in the null-terminated string
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
.SH NAME
|
.SH NAME
|
||||||
strtape \- convert string to tape device pathname
|
strtape \- convert string to tape device pathname
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.L "char* strtape(char* s, char** e)"
|
.L "char* strtape(const char* s, char** e)"
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.I strtape
|
.I strtape
|
||||||
converts the generic tape device specification in the null-terminated string
|
converts the generic tape device specification in the null-terminated string
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
.SH NAME
|
.SH NAME
|
||||||
strton \- convert string to long integer
|
strton \- convert string to long integer
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.L "long strton(char* s, char** e)"
|
.L "long strton(const char* s, char** e, char *basep, int m)"
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.I strton
|
.I strton
|
||||||
converts the null-terminated string
|
converts the null-terminated string
|
||||||
|
|
|
@ -29,7 +29,7 @@ static char** ids;
|
||||||
static const char* dflt[] = { "ast", "standard", 0 };
|
static const char* dflt[] = { "ast", "standard", 0 };
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* initialize the conformance() id list
|
* initialize the conformance() ID list
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static char**
|
static char**
|
||||||
|
@ -97,8 +97,8 @@ initconformance(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* return conformance id if s size n is in conformance
|
* return conformance ID if s size n is in conformance
|
||||||
* prefix match of s on the conformance id table
|
* prefix match of s on the conformance ID table
|
||||||
* s==0 => "standard"
|
* s==0 => "standard"
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -139,7 +139,7 @@ typedef struct Push_s
|
||||||
typedef struct Tag_s
|
typedef struct Tag_s
|
||||||
{
|
{
|
||||||
unsigned char level; /* indent level */
|
unsigned char level; /* indent level */
|
||||||
unsigned char id; /* TAG_* id */
|
unsigned char id; /* TAG_* ID */
|
||||||
} Tag_t;
|
} Tag_t;
|
||||||
|
|
||||||
typedef struct Indent_s
|
typedef struct Indent_s
|
||||||
|
|
|
@ -101,7 +101,7 @@ typedef struct Optstate_s
|
||||||
Dtdisc_t msgdisc; /* msgdict discipline */
|
Dtdisc_t msgdisc; /* msgdict discipline */
|
||||||
Dt_t* msgdict; /* default ast.id catalog msgs */
|
Dt_t* msgdict; /* default ast.id catalog msgs */
|
||||||
Optcache_t* cache; /* OPT_cache cache */
|
Optcache_t* cache; /* OPT_cache cache */
|
||||||
char** conformance; /* conformance id vector */
|
char** conformance; /* conformance ID vector */
|
||||||
} Optstate_t;
|
} Optstate_t;
|
||||||
|
|
||||||
#define _OPT_PRIVATE_ \
|
#define _OPT_PRIVATE_ \
|
||||||
|
|
|
@ -29,7 +29,7 @@ static const char id[] = "\n@(#)$Id: ast (AT&T Research) 2012-05-28 $\0\n";
|
||||||
|
|
||||||
_Ast_info_t _ast_info =
|
_Ast_info_t _ast_info =
|
||||||
{
|
{
|
||||||
"libast", /* id */
|
"libast", /* ID */
|
||||||
{ 0 },
|
{ 0 },
|
||||||
0,0,0,0,0,
|
0,0,0,0,0,
|
||||||
strcmp, /* collate */
|
strcmp, /* collate */
|
||||||
|
|
|
@ -422,7 +422,7 @@ char *_stkseek(register Sfio_t *stream, register ssize_t n)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* advance the stack to the current top
|
* advance the stack to the current top
|
||||||
* if extra is non-zero, first add a extra bytes and zero the first
|
* if extra is non-zero, first add extra bytes and zero the first
|
||||||
*/
|
*/
|
||||||
char *stkfreeze(register Sfio_t *stream, register size_t extra)
|
char *stkfreeze(register Sfio_t *stream, register size_t extra)
|
||||||
{
|
{
|
||||||
|
|
|
@ -349,7 +349,7 @@ translate(const char* loc, const char* cmd, const char* cat, const char* msg)
|
||||||
!(cp = mp->cat))
|
!(cp = mp->cat))
|
||||||
{
|
{
|
||||||
#if DEBUG_trace > 1
|
#if DEBUG_trace > 1
|
||||||
sfprintf(sfstderr, "AHA#%d:%s cmd %s cat %s:%s id %s msg `%s'\n", __LINE__, __FILE__, cmd, cat, error_info.catalog, ast.id, msg);
|
sfprintf(sfstderr, "AHA#%d:%s cmd %s cat %s:%s ID %s msg `%s'\n", __LINE__, __FILE__, cmd, cat, error_info.catalog, ast.id, msg);
|
||||||
#endif
|
#endif
|
||||||
cp = 0;
|
cp = 0;
|
||||||
goto done;
|
goto done;
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
*
|
*
|
||||||
* SHELL is read from the environment and must start with /
|
* SHELL is read from the environment and must start with /
|
||||||
*
|
*
|
||||||
* if set-uid or set-gid then the executable and its containing
|
* if setuid or setgid then the executable and its containing
|
||||||
* directory must not be owned by the real user/group
|
* directory must not be owned by the real user/group
|
||||||
*
|
*
|
||||||
* root/administrator has its own test
|
* root/administrator has its own test
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
/*
|
/*
|
||||||
* return 1 if files a and b are the same under preroot
|
* return 1 if files a and b are the same under preroot
|
||||||
*
|
*
|
||||||
* NOTE: the kernel disables preroot for set-uid processes
|
* NOTE: the kernel disables preroot for setuid processes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
|
@ -669,7 +669,7 @@ struct _sfrsrv_s
|
||||||
/* co-process structure */
|
/* co-process structure */
|
||||||
typedef struct _sfproc_s Sfproc_t;
|
typedef struct _sfproc_s Sfproc_t;
|
||||||
struct _sfproc_s
|
struct _sfproc_s
|
||||||
{ int pid; /* process id */
|
{ int pid; /* process ID */
|
||||||
uchar* rdata; /* read data being cached */
|
uchar* rdata; /* read data being cached */
|
||||||
int ndata; /* size of cached data */
|
int ndata; /* size of cached data */
|
||||||
int size; /* buffer size */
|
int size; /* buffer size */
|
||||||
|
|
|
@ -147,7 +147,7 @@ int _sfsetpool(Sfio_t* f)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* always add at end of array because if this was done during some sort
|
/* always add at end of array because if this was done during some sort
|
||||||
of walk thru all streams, we'll want the new stream to be seen.
|
of walk through all streams, we'll want the new stream to be seen.
|
||||||
*/
|
*/
|
||||||
p->sf[p->n_sf++] = f;
|
p->sf[p->n_sf++] = f;
|
||||||
rv = 0;
|
rv = 0;
|
||||||
|
|
|
@ -126,7 +126,7 @@ struct _vtmutex_s
|
||||||
/* structure for states of thread */
|
/* structure for states of thread */
|
||||||
struct _vthread_s
|
struct _vthread_s
|
||||||
{ _vtself_t self; /* self-handle */
|
{ _vtself_t self; /* self-handle */
|
||||||
_vtid_t id; /* thread id */
|
_vtid_t id; /* thread ID */
|
||||||
_vtattr_t attrs; /* attributes */
|
_vtattr_t attrs; /* attributes */
|
||||||
size_t stack; /* stack size */
|
size_t stack; /* stack size */
|
||||||
int state; /* execution state */
|
int state; /* execution state */
|
||||||
|
|
|
@ -129,7 +129,7 @@ ccmaplist(Ccmap_t* mp)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* return ccode map id given name
|
* return ccode map ID given name
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -158,7 +158,7 @@ ccmapid(const char* name)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* return ccode map name given id
|
* return ccode map name given ID
|
||||||
*/
|
*/
|
||||||
|
|
||||||
char*
|
char*
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
* Glenn Fowler
|
* Glenn Fowler
|
||||||
* AT&T Bell Laboratories
|
* AT&T Bell Laboratories
|
||||||
*
|
*
|
||||||
* cached gid number -> name
|
* cached GID number -> group name
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(__STDPP__directive) && defined(__STDPP__hide)
|
#if defined(__STDPP__directive) && defined(__STDPP__hide)
|
||||||
|
@ -53,7 +53,7 @@ typedef struct Id_s
|
||||||
} Id_t;
|
} Id_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* return gid name given gid number
|
* return group name for given GID number
|
||||||
*/
|
*/
|
||||||
|
|
||||||
char*
|
char*
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
* Glenn Fowler
|
* Glenn Fowler
|
||||||
* AT&T Bell Laboratories
|
* AT&T Bell Laboratories
|
||||||
*
|
*
|
||||||
* uid number -> name
|
* UID number -> user name
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(__STDPP__directive) && defined(__STDPP__hide)
|
#if defined(__STDPP__directive) && defined(__STDPP__hide)
|
||||||
|
@ -53,7 +53,7 @@ typedef struct Id_s
|
||||||
} Id_t;
|
} Id_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* return uid name given uid number
|
* return user name for given UID number
|
||||||
*/
|
*/
|
||||||
|
|
||||||
char*
|
char*
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
* Glenn Fowler
|
* Glenn Fowler
|
||||||
* AT&T Bell Laboratories
|
* AT&T Bell Laboratories
|
||||||
*
|
*
|
||||||
* gid name -> number
|
* group name -> GID number
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(__STDPP__directive) && defined(__STDPP__hide)
|
#if defined(__STDPP__directive) && defined(__STDPP__hide)
|
||||||
|
@ -60,8 +60,8 @@ typedef struct Id_s
|
||||||
} Id_t;
|
} Id_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* return gid number given gid/uid name
|
* return GID number for given group name
|
||||||
* gid attempted first, then uid->pw_gid
|
* gr->gr_gid attempted first, then pw->pw_gid
|
||||||
* -1 on first error for a given name
|
* -1 on first error for a given name
|
||||||
* -2 on subsequent errors for a given name
|
* -2 on subsequent errors for a given name
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
* Glenn Fowler
|
* Glenn Fowler
|
||||||
* AT&T Bell Laboratories
|
* AT&T Bell Laboratories
|
||||||
*
|
*
|
||||||
* uid name -> number
|
* user name -> UID
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(__STDPP__directive) && defined(__STDPP__hide)
|
#if defined(__STDPP__directive) && defined(__STDPP__hide)
|
||||||
|
@ -56,7 +56,7 @@ typedef struct Id_s
|
||||||
} Id_t;
|
} Id_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* return uid number given uid name
|
* return UID number for given user name
|
||||||
* -1 on first error for a given name
|
* -1 on first error for a given name
|
||||||
* -2 on subsequent errors for a given name
|
* -2 on subsequent errors for a given name
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -204,7 +204,7 @@ static int mminit(Mmdisc_t* mmdc)
|
||||||
MAP_SHARED, fd, (off_t)0 );
|
MAP_SHARED, fd, (off_t)0 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ /* make the key and get/create an id for the share mem segment */
|
{ /* make the key and get/create an ID for the share mem segment */
|
||||||
if((key = ftok(mmdc->file, mmdc->proj)) < 0 )
|
if((key = ftok(mmdc->file, mmdc->proj)) < 0 )
|
||||||
goto done;
|
goto done;
|
||||||
if((mmdc->shmid = shmget(key, size, IPC_CREAT|FILE_MODE)) < 0 )
|
if((mmdc->shmid = shmget(key, size, IPC_CREAT|FILE_MODE)) < 0 )
|
||||||
|
|
|
@ -64,7 +64,7 @@ static void* poolalloc(Vmalloc_t* vm, reg size_t size, int local)
|
||||||
|
|
||||||
size = ROUND(size,ALIGN);
|
size = ROUND(size,ALIGN);
|
||||||
|
|
||||||
/* look thru all segments for a suitable free block */
|
/* look through all segments for a suitable free block */
|
||||||
for(tp = NIL(Block_t*), seg = vd->seg; seg; seg = seg->next)
|
for(tp = NIL(Block_t*), seg = vd->seg; seg; seg = seg->next)
|
||||||
{ if((tp = seg->free) &&
|
{ if((tp = seg->free) &&
|
||||||
(s = (SIZE(tp) & ~BITS) + sizeof(Head_t)) >= size )
|
(s = (SIZE(tp) & ~BITS) + sizeof(Head_t)) >= size )
|
||||||
|
|
|
@ -92,7 +92,7 @@
|
||||||
08-04-01 stty.c: fix off2 uninitialized reference
|
08-04-01 stty.c: fix off2 uninitialized reference
|
||||||
08-03-28 chgrp.c: add --before=file
|
08-03-28 chgrp.c: add --before=file
|
||||||
08-03-14 pids.c: add
|
08-03-14 pids.c: add
|
||||||
08-03-11 chgrp.c: fix -m to use uid:gid as lookup key
|
08-03-11 chgrp.c: fix -m to use UID:GID as lookup key
|
||||||
08-02-11 Makefile: add -lmd possibly required by sumlib.o -- hack alert
|
08-02-11 Makefile: add -lmd possibly required by sumlib.o -- hack alert
|
||||||
08-01-30 expr.c: fix <=0 type that broke substr * 1 * -- wow
|
08-01-30 expr.c: fix <=0 type that broke substr * 1 * -- wow
|
||||||
07-12-13 cp.c: fix builtin state reinitialization
|
07-12-13 cp.c: fix builtin state reinitialization
|
||||||
|
@ -299,7 +299,7 @@
|
||||||
mkdir: fix -p default mode
|
mkdir: fix -p default mode
|
||||||
97-12-07 mkdir: fix umask() reset
|
97-12-07 mkdir: fix umask() reset
|
||||||
97-11-11 chown,chgrp: proper interpretation of -h,-l for lchown()
|
97-11-11 chown,chgrp: proper interpretation of -h,-l for lchown()
|
||||||
chown,chgrp: only chown() if uid or gid change
|
chown,chgrp: only chown() if UID or GID change
|
||||||
97-10-31 mkdir: do umask right
|
97-10-31 mkdir: do umask right
|
||||||
97-08-11 cmdinit: clear opt_info.index to allow multiple calls
|
97-08-11 cmdinit: clear opt_info.index to allow multiple calls
|
||||||
cp,ln,mv: add
|
cp,ln,mv: add
|
||||||
|
@ -324,7 +324,7 @@
|
||||||
add void* context 3rd arg to b_main()
|
add void* context 3rd arg to b_main()
|
||||||
95-05-09 add getconf
|
95-05-09 add getconf
|
||||||
cat -u avoids mmap
|
cat -u avoids mmap
|
||||||
add chown|chgrp -m uid|gid map file
|
add chown|chgrp -m UID|GID map file
|
||||||
add chown|chgrp -P for systems with lchown(2)
|
add chown|chgrp -P for systems with lchown(2)
|
||||||
chown|chgrp -P => lstat() too!
|
chown|chgrp -P => lstat() too!
|
||||||
chmod|chown|chgrp -HLP
|
chmod|chown|chgrp -HLP
|
||||||
|
|
|
@ -36,7 +36,7 @@ static const char usage_grp_1[] =
|
||||||
"[+NAME?chgrp - change the group ownership of files]"
|
"[+NAME?chgrp - change the group ownership of files]"
|
||||||
"[+DESCRIPTION?\bchgrp\b changes the group ownership of each file"
|
"[+DESCRIPTION?\bchgrp\b changes the group ownership of each file"
|
||||||
" to \agroup\a, which can be either a group name or a numeric"
|
" to \agroup\a, which can be either a group name or a numeric"
|
||||||
" group id. The user ownership of each file may also be changed to"
|
" group ID. The user ownership of each file may also be changed to"
|
||||||
" \auser\a by prepending \auser\a\b:\b to the group name.]"
|
" \auser\a by prepending \auser\a\b:\b to the group name.]"
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ static const char usage_own_1[] =
|
||||||
"[+NAME?chown - change the ownership of files]"
|
"[+NAME?chown - change the ownership of files]"
|
||||||
"[+DESCRIPTION?\bchown\b changes the ownership of each file"
|
"[+DESCRIPTION?\bchown\b changes the ownership of each file"
|
||||||
" to \auser\a, which can be either a user name or a numeric"
|
" to \auser\a, which can be either a user name or a numeric"
|
||||||
" user id. The group ownership of each file may also be changed to"
|
" user ID. The group ownership of each file may also be changed to"
|
||||||
" \auser\a by appending \b:\b\agroup\a to the user name.]"
|
" \auser\a by appending \b:\b\agroup\a to the user name.]"
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -65,10 +65,10 @@ static const char usage_2[] =
|
||||||
"determined it is not overridden by any subsequent match. Unmatched "
|
"determined it is not overridden by any subsequent match. Unmatched "
|
||||||
"files are silently ignored.]"
|
"files are silently ignored.]"
|
||||||
"[n:show?Show actions but don't execute.]"
|
"[n:show?Show actions but don't execute.]"
|
||||||
"[N:numeric?By default numeric user and group id operands are first "
|
"[N:numeric?By default numeric user and group ID operands are first "
|
||||||
"interpreted as names; if no name exists then they are interpreted as "
|
"interpreted as names; if no name exists then they are interpreted as "
|
||||||
"explicit numeric ids. \b--numeric\b interprets numeric id operands as "
|
"explicit numeric IDs. \b--numeric\b interprets numeric ID operands as "
|
||||||
"numeric ids.]"
|
"numeric IDs.]"
|
||||||
"[r:reference?Omit the explicit ownership operand and use the ownership "
|
"[r:reference?Omit the explicit ownership operand and use the ownership "
|
||||||
"of \afile\a instead.]:[file]"
|
"of \afile\a instead.]:[file]"
|
||||||
"[u:unmapped?Print a diagnostic for each file for which either the "
|
"[u:unmapped?Print a diagnostic for each file for which either the "
|
||||||
|
@ -117,13 +117,13 @@ __STDPP__directive pragma pp:nohide lchown
|
||||||
#undef lchown
|
#undef lchown
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct Key_s /* uid/gid key */
|
typedef struct Key_s /* UID/GID key */
|
||||||
{
|
{
|
||||||
int uid; /* uid */
|
int uid; /* UID */
|
||||||
int gid; /* gid */
|
int gid; /* GID */
|
||||||
} Key_t;
|
} Key_t;
|
||||||
|
|
||||||
typedef struct Map_s /* uid/gid map */
|
typedef struct Map_s /* UID/GID map */
|
||||||
{
|
{
|
||||||
Dtlink_t link; /* dictionary link */
|
Dtlink_t link; /* dictionary link */
|
||||||
Key_t key; /* key */
|
Key_t key; /* key */
|
||||||
|
@ -132,19 +132,19 @@ typedef struct Map_s /* uid/gid map */
|
||||||
|
|
||||||
#define OPT_CHOWN 0x0001 /* chown */
|
#define OPT_CHOWN 0x0001 /* chown */
|
||||||
#define OPT_FORCE 0x0002 /* ignore errors */
|
#define OPT_FORCE 0x0002 /* ignore errors */
|
||||||
#define OPT_GID 0x0004 /* have gid */
|
#define OPT_GID 0x0004 /* have GID */
|
||||||
#define OPT_LCHOWN 0x0008 /* lchown */
|
#define OPT_LCHOWN 0x0008 /* lchown */
|
||||||
#define OPT_NUMERIC 0x0010 /* favor numeric ids */
|
#define OPT_NUMERIC 0x0010 /* favor numeric IDs */
|
||||||
#define OPT_SHOW 0x0020 /* show but don't do */
|
#define OPT_SHOW 0x0020 /* show but don't do */
|
||||||
#define OPT_TEST 0x0040 /* canonicalize output */
|
#define OPT_TEST 0x0040 /* canonicalize output */
|
||||||
#define OPT_UID 0x0080 /* have uid */
|
#define OPT_UID 0x0080 /* have UID */
|
||||||
#define OPT_UNMAPPED 0x0100 /* unmapped file diagnostic */
|
#define OPT_UNMAPPED 0x0100 /* unmapped file diagnostic */
|
||||||
#define OPT_VERBOSE 0x0200 /* have uid */
|
#define OPT_VERBOSE 0x0200 /* have UID */
|
||||||
|
|
||||||
extern int lchown(const char*, uid_t, gid_t);
|
extern int lchown(const char*, uid_t, gid_t);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* parse uid and gid from s
|
* parse UID and GID from s
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -483,11 +483,11 @@ b_chgrp(int argc, char** argv, Shbltin_t* context)
|
||||||
if ((options & OPT_UNMAPPED) && (uid < 0 || gid < 0))
|
if ((options & OPT_UNMAPPED) && (uid < 0 || gid < 0))
|
||||||
{
|
{
|
||||||
if (uid < 0 && gid < 0)
|
if (uid < 0 && gid < 0)
|
||||||
error(ERROR_warn(0), "%s: uid and gid not mapped", ent->fts_path);
|
error(ERROR_warn(0), "%s: UID and GID not mapped", ent->fts_path);
|
||||||
else if (uid < 0)
|
else if (uid < 0)
|
||||||
error(ERROR_warn(0), "%s: uid not mapped", ent->fts_path);
|
error(ERROR_warn(0), "%s: UID not mapped", ent->fts_path);
|
||||||
else
|
else
|
||||||
error(ERROR_warn(0), "%s: gid not mapped", ent->fts_path);
|
error(ERROR_warn(0), "%s: GID not mapped", ent->fts_path);
|
||||||
}
|
}
|
||||||
if (uid != ent->fts_statp->st_uid && uid >= 0 || gid != ent->fts_statp->st_gid && gid >= 0)
|
if (uid != ent->fts_statp->st_uid && uid >= 0 || gid != ent->fts_statp->st_gid && gid >= 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -121,7 +121,7 @@ typedef struct State_s /* program state */
|
||||||
int all; /* list all items */
|
int all; /* list all items */
|
||||||
Sfio_t* check; /* check previous output */
|
Sfio_t* check; /* check previous output */
|
||||||
int flags; /* sumprint() SUM_* flags */
|
int flags; /* sumprint() SUM_* flags */
|
||||||
gid_t gid; /* caller gid */
|
gid_t gid; /* caller GID */
|
||||||
int header; /* list method on output */
|
int header; /* list method on output */
|
||||||
int list; /* list file name too */
|
int list; /* list file name too */
|
||||||
Sum_t* oldsum; /* previous sum method */
|
Sum_t* oldsum; /* previous sum method */
|
||||||
|
@ -135,7 +135,7 @@ typedef struct State_s /* program state */
|
||||||
Sum_t* sum; /* sum method */
|
Sum_t* sum; /* sum method */
|
||||||
int text; /* \r\n == \n */
|
int text; /* \r\n == \n */
|
||||||
int total; /* list totals only */
|
int total; /* list totals only */
|
||||||
uid_t uid; /* caller uid */
|
uid_t uid; /* caller UID */
|
||||||
int warn; /* invalid check line warnings */
|
int warn; /* invalid check line warnings */
|
||||||
} State_t;
|
} State_t;
|
||||||
|
|
||||||
|
@ -336,7 +336,7 @@ verify(State_t* state, register char* s, char* check, Sfio_t* rp)
|
||||||
if (state->silent)
|
if (state->silent)
|
||||||
error_info.errors++;
|
error_info.errors++;
|
||||||
else
|
else
|
||||||
error(2, "%s: uid should be %s", file, fmtuid(uid));
|
error(2, "%s: UID should be %s", file, fmtuid(uid));
|
||||||
}
|
}
|
||||||
if (gid < 0 || gid == st.st_gid)
|
if (gid < 0 || gid == st.st_gid)
|
||||||
gid = -1;
|
gid = -1;
|
||||||
|
@ -345,7 +345,7 @@ verify(State_t* state, register char* s, char* check, Sfio_t* rp)
|
||||||
if (state->silent)
|
if (state->silent)
|
||||||
error_info.errors++;
|
error_info.errors++;
|
||||||
else
|
else
|
||||||
error(2, "%s: gid should be %s", file, fmtgid(gid));
|
error(2, "%s: GID should be %s", file, fmtgid(gid));
|
||||||
}
|
}
|
||||||
if (state->permissions && (uid >= 0 || gid >= 0))
|
if (state->permissions && (uid >= 0 || gid >= 0))
|
||||||
{
|
{
|
||||||
|
|
|
@ -45,7 +45,7 @@ static const char usage_cp[] =
|
||||||
"[A:attributes?Preserve selected file attributes:]:[eipt]"
|
"[A:attributes?Preserve selected file attributes:]:[eipt]"
|
||||||
"{"
|
"{"
|
||||||
"[+e?Everything permissible.]"
|
"[+e?Everything permissible.]"
|
||||||
"[+i?Owner uid and gid.]"
|
"[+i?Owner UID and GID.]"
|
||||||
"[+p?Permissions.]"
|
"[+p?Permissions.]"
|
||||||
"[+t?Access and modify times.]"
|
"[+t?Access and modify times.]"
|
||||||
"}"
|
"}"
|
||||||
|
@ -144,7 +144,7 @@ static const char usage_tail[] =
|
||||||
#define LN 2
|
#define LN 2
|
||||||
#define MV 3
|
#define MV 3
|
||||||
|
|
||||||
#define PRESERVE_IDS 0x1 /* preserve uid gid */
|
#define PRESERVE_IDS 0x1 /* preserve UID and GID */
|
||||||
#define PRESERVE_PERM 0x2 /* preserve permissions */
|
#define PRESERVE_PERM 0x2 /* preserve permissions */
|
||||||
#define PRESERVE_TIME 0x4 /* preserve times */
|
#define PRESERVE_TIME 0x4 /* preserve times */
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ typedef struct State_s /* program state */
|
||||||
int remove; /* remove destination before op */
|
int remove; /* remove destination before op */
|
||||||
int suflen; /* strlen(state.suffix) */
|
int suflen; /* strlen(state.suffix) */
|
||||||
int sync; /* fsync() each file after copy */
|
int sync; /* fsync() each file after copy */
|
||||||
int uid; /* caller uid */
|
int uid; /* caller UID */
|
||||||
int update; /* replace only if newer */
|
int update; /* replace only if newer */
|
||||||
int verbose; /* list each file before op */
|
int verbose; /* list each file before op */
|
||||||
int wflags; /* open() for write flags */
|
int wflags; /* open() for write flags */
|
||||||
|
|
|
@ -25,22 +25,22 @@
|
||||||
static const char usage[] =
|
static const char usage[] =
|
||||||
"[-?\n@(#)$Id: pids (AT&T Research) 2011-08-27 $\n]"
|
"[-?\n@(#)$Id: pids (AT&T Research) 2011-08-27 $\n]"
|
||||||
"[--catalog?" ERROR_CATALOG "]"
|
"[--catalog?" ERROR_CATALOG "]"
|
||||||
"[+NAME?pids - list calling shell process ids]"
|
"[+NAME?pids - list calling shell process IDs]"
|
||||||
"[+DESCRIPTION?When invoked as a shell builtin, \bpids\b lists one or "
|
"[+DESCRIPTION?When invoked as a shell builtin, \bpids\b lists one or "
|
||||||
"more of the calling process ids determined by \bgetpid\b(2), "
|
"more of the calling process IDs determined by \bgetpid\b(2), "
|
||||||
"\bgetppid\b(2), \bgetpgrp\b(2), \btcgetpgrp\b(3) and \bgetsid\b(2). "
|
"\bgetppid\b(2), \bgetpgrp\b(2), \btcgetpgrp\b(3) and \bgetsid\b(2). "
|
||||||
"Unknown or invalid ids have the value \b-1\b.]"
|
"Unknown or invalid IDs have the value \b-1\b.]"
|
||||||
"[f:format?List the ids specified by \aformat\a. \aformat\a follows "
|
"[f:format?List the IDs specified by \aformat\a. \aformat\a follows "
|
||||||
"\bprintf\b(3) conventions, except that \bsfio\b(3) inline ids are used "
|
"\bprintf\b(3) conventions, except that \bsfio\b(3) inline IDs are used "
|
||||||
"instead of arguments: "
|
"instead of arguments: "
|
||||||
"%[-+]][\awidth\a[.\aprecis\a[.\abase\a]]]]]](\aid\a)\achar\a. The "
|
"%[-+]][\awidth\a[.\aprecis\a[.\abase\a]]]]]](\aid\a)\achar\a. The "
|
||||||
"supported \aid\as are:]:[format:=" FORMAT "]"
|
"supported \aid\as are:]:[format:=" FORMAT "]"
|
||||||
"{"
|
"{"
|
||||||
"[+pid?The process id.]"
|
"[+pid?The process ID.]"
|
||||||
"[+pgid?The process group id.]"
|
"[+pgid?The process group ID.]"
|
||||||
"[+ppid?The parent process id.]"
|
"[+ppid?The parent process ID.]"
|
||||||
"[+tid|tty?The controlling terminal id.]"
|
"[+tid|tty?The controlling terminal ID.]"
|
||||||
"[+sid?The session id.]"
|
"[+sid?The session ID.]"
|
||||||
"}"
|
"}"
|
||||||
"[+SEE ALSO?\bgetpid\b(2), \bgetppid\b(2), \bgetpgrp\b(2), "
|
"[+SEE ALSO?\bgetpid\b(2), \bgetppid\b(2), \bgetpgrp\b(2), "
|
||||||
"\btcgetpgrp\b(3), \bgetsid\b(2)]"
|
"\btcgetpgrp\b(3), \bgetsid\b(2)]"
|
||||||
|
|
|
@ -86,7 +86,7 @@ typedef struct State_s /* program state */
|
||||||
int interactive; /* prompt for approval */
|
int interactive; /* prompt for approval */
|
||||||
int recursive; /* remove subtrees too */
|
int recursive; /* remove subtrees too */
|
||||||
int terminal; /* attached to terminal */
|
int terminal; /* attached to terminal */
|
||||||
int uid; /* caller uid */
|
int uid; /* caller UID */
|
||||||
int unconditional; /* enable dir rwx on preorder */
|
int unconditional; /* enable dir rwx on preorder */
|
||||||
int verbose; /* display each file */
|
int verbose; /* display each file */
|
||||||
#if _lib_fsync
|
#if _lib_fsync
|
||||||
|
|
|
@ -37,7 +37,7 @@ static const char usage[] =
|
||||||
"[g:save?Writes the current settings to standard output in a form that "
|
"[g:save?Writes the current settings to standard output in a form that "
|
||||||
"can be used as an argument to another \bstty\b command. The \brows\b "
|
"can be used as an argument to another \bstty\b command. The \brows\b "
|
||||||
"and \bcolumns\b values are not included.]"
|
"and \bcolumns\b values are not included.]"
|
||||||
"[t:terminal-group?Print the terminal group id of the device, -1 if "
|
"[t:terminal-group?Print the terminal group ID of the device, -1 if "
|
||||||
"unknown.]"
|
"unknown.]"
|
||||||
"\n"
|
"\n"
|
||||||
"\n[mode ...]\n"
|
"\n[mode ...]\n"
|
||||||
|
|
|
@ -55,7 +55,7 @@ static const char usage[] =
|
||||||
"[i:implementation|platform|hardware-platform?The hardware implementation;"
|
"[i:implementation|platform|hardware-platform?The hardware implementation;"
|
||||||
" this is \b--host-id\b on some systems.]"
|
" this is \b--host-id\b on some systems.]"
|
||||||
"[o:operating-system?The generic operating system name.]"
|
"[o:operating-system?The generic operating system name.]"
|
||||||
"[h:host-id|id?The host id in hex.]"
|
"[h:host-id|id?The host ID in hex.]"
|
||||||
"[d:domain?The domain name returned by \agetdomainname\a(2).]"
|
"[d:domain?The domain name returned by \agetdomainname\a(2).]"
|
||||||
"[R:extended-release?The extended release name.]"
|
"[R:extended-release?The extended release name.]"
|
||||||
"[A:everything?Equivalent to \b-snrvmpiohdR\b.]"
|
"[A:everything?Equivalent to \b-snrvmpiohdR\b.]"
|
||||||
|
|
|
@ -34,8 +34,8 @@ static const char usage[] =
|
||||||
"[+NAME?vmstate - list the calling process vmalloc region state]"
|
"[+NAME?vmstate - list the calling process vmalloc region state]"
|
||||||
"[+DESCRIPTION?When invoked as a shell builtin, \bvmstate\b lists the "
|
"[+DESCRIPTION?When invoked as a shell builtin, \bvmstate\b lists the "
|
||||||
"calling process \bvmalloc\b(3) state for all regions.]"
|
"calling process \bvmalloc\b(3) state for all regions.]"
|
||||||
"[f:format?List the ids specified by \aformat\a. \aformat\a follows "
|
"[f:format?List the IDs specified by \aformat\a. \aformat\a follows "
|
||||||
"\bprintf\b(3) conventions, except that \bsfio\b(3) inline ids are used "
|
"\bprintf\b(3) conventions, except that \bsfio\b(3) inline IDs are used "
|
||||||
"instead of arguments: "
|
"instead of arguments: "
|
||||||
"%[-+]][\awidth\a[.\aprecis\a[.\abase\a]]]]]](\aid\a)\achar\a. The "
|
"%[-+]][\awidth\a[.\aprecis\a[.\abase\a]]]]]](\aid\a)\achar\a. The "
|
||||||
"supported \aid\as are:]:[format:=" FORMAT "]"
|
"supported \aid\as are:]:[format:=" FORMAT "]"
|
||||||
|
|
|
@ -226,7 +226,7 @@ dllsopen(const char* lib, const char* name, const char* version)
|
||||||
if (lib && *lib && (*lib != '-' || *(lib + 1)))
|
if (lib && *lib && (*lib != '-' || *(lib + 1)))
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* grab the local part of the library id
|
* grab the local part of the library ID
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (s = strrchr(lib, ':'))
|
if (s = strrchr(lib, ':'))
|
||||||
|
|
Loading…
Reference in a new issue