merge
This commit is contained in:
parent
26f132bfc3
commit
3bdb721a73
@ -1,5 +1,5 @@
|
|||||||
/* $MirBSD: history.c,v 1.8 2004/05/24 19:56:09 tg Exp $ */
|
/** $MirBSD: history.c,v 1.9 2004/08/27 14:08:35 tg Stab $ */
|
||||||
/* $OpenBSD: history.c,v 1.22 2003/05/18 01:02:42 jsyn Exp $ */
|
/* $OpenBSD: history.c,v 1.24 2004/08/03 12:44:59 danh Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* command history
|
* command history
|
||||||
@ -87,6 +87,11 @@ c_fc(wp)
|
|||||||
char *first = (char *) 0, *last = (char *) 0;
|
char *first = (char *) 0, *last = (char *) 0;
|
||||||
char **hfirst, **hlast, **hp;
|
char **hfirst, **hlast, **hp;
|
||||||
|
|
||||||
|
if (!Flag(FTALKING_I)) {
|
||||||
|
bi_errorf("history functions not available");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
while ((optc = ksh_getopt(wp, &builtin_opt, "e:glnrs0,1,2,3,4,5,6,7,8,9,")) != EOF)
|
while ((optc = ksh_getopt(wp, &builtin_opt, "e:glnrs0,1,2,3,4,5,6,7,8,9,")) != EOF)
|
||||||
switch (optc) {
|
switch (optc) {
|
||||||
case 'e':
|
case 'e':
|
||||||
|
123
ksh.1tbl
123
ksh.1tbl
@ -1,5 +1,5 @@
|
|||||||
.\" $MirBSD: ksh.1tbl,v 1.27 2004/08/10 20:43:20 tg Exp $
|
.\" $MirBSD: ksh.1tbl,v 1.28 2004/08/27 14:08:35 tg Stab $
|
||||||
.\" $OpenBSD: ksh.1tbl,v 1.70 2004/05/09 06:07:42 otto Exp $
|
.\" $OpenBSD: ksh.1tbl,v 1.72 2004/08/07 16:46:58 millert Exp $
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright (c) 1980, 1990, 1993
|
.\" Copyright (c) 1980, 1990, 1993
|
||||||
.\" The Regents of the University of California. All rights reserved.
|
.\" The Regents of the University of California. All rights reserved.
|
||||||
@ -42,11 +42,15 @@
|
|||||||
.Nm
|
.Nm
|
||||||
.Op Fl +abCefhiklmnprsuvxX
|
.Op Fl +abCefhiklmnprsuvxX
|
||||||
.Op Fl +o Ar option
|
.Op Fl +o Ar option
|
||||||
.Oo [ Fl c Ar command-string [
|
.Xo
|
||||||
.Xo Ar command-name ] No \&| Fl s No \&|
|
.Bk -words
|
||||||
.Ar file No ]\ \&
|
.Oo Oo Fl c Ar command-string
|
||||||
.Xc
|
.Op Ar command-name
|
||||||
|
.Li \&| Fl s
|
||||||
|
.Li \&| Ar file Oc
|
||||||
|
.Ek
|
||||||
.Op Ar argument ... Oc
|
.Op Ar argument ... Oc
|
||||||
|
.Xc
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
.Nm
|
.Nm
|
||||||
is a command interpreter intended for both interactive and shell
|
is a command interpreter intended for both interactive and shell
|
||||||
@ -85,11 +89,15 @@ of a file the shell reads commands from.
|
|||||||
If there are no non-option
|
If there are no non-option
|
||||||
arguments, the shell reads commands from the standard input.
|
arguments, the shell reads commands from the standard input.
|
||||||
The name of
|
The name of
|
||||||
the shell (i.e., the contents of $0) is determined as follows: if the
|
the shell (i.e., the contents of
|
||||||
|
.Va $0 )
|
||||||
|
is determined as follows: if the
|
||||||
.Fl c
|
.Fl c
|
||||||
option is used and there is a non-option argument, it is used as the name;
|
option is used and there is a non-option argument, it is used as the name;
|
||||||
if commands are being read from a file, the file is used as the name;
|
if commands are being read from a file, the file is used as the name;
|
||||||
otherwise, the name the shell was called with (i.e., argv[0]) is used.
|
otherwise, the name the shell was called with (i.e.,
|
||||||
|
.Li argv[0] )
|
||||||
|
is used.
|
||||||
.Pp
|
.Pp
|
||||||
A shell is
|
A shell is
|
||||||
.Dq interactive
|
.Dq interactive
|
||||||
@ -109,7 +117,7 @@ and
|
|||||||
parameters).
|
parameters).
|
||||||
For non-interactive shells, the
|
For non-interactive shells, the
|
||||||
.Ic trackall
|
.Ic trackall
|
||||||
option is on by default (see
|
option is on by default (see the
|
||||||
.Ic set
|
.Ic set
|
||||||
command below).
|
command below).
|
||||||
.Pp
|
.Pp
|
||||||
@ -180,7 +188,8 @@ is processed.
|
|||||||
Clearing the privileged option causes the shell to set
|
Clearing the privileged option causes the shell to set
|
||||||
its effective user ID (group ID) to its real user ID (group ID).
|
its effective user ID (group ID) to its real user ID (group ID).
|
||||||
.Pp
|
.Pp
|
||||||
If the basename of the name the shell is called with (i.e., argv[0])
|
If the basename of the name the shell is called with (i.e.,
|
||||||
|
.Li argv[0] )
|
||||||
starts with
|
starts with
|
||||||
.Ql -
|
.Ql -
|
||||||
or if the
|
or if the
|
||||||
@ -563,7 +572,7 @@ if no
|
|||||||
.Ar list
|
.Ar list
|
||||||
is executed, the exit status is zero.
|
is executed, the exit status is zero.
|
||||||
.It Xo Ic for Ar name No [
|
.It Xo Ic for Ar name No [
|
||||||
.Ic in Ar word Ar ... term Ns ]
|
.Ic in Ar word ... term Ns ]
|
||||||
.Ic do Ar list Ic done
|
.Ic do Ar list Ic done
|
||||||
.Xc
|
.Xc
|
||||||
For each
|
For each
|
||||||
@ -575,7 +584,11 @@ is set to the word and
|
|||||||
is executed.
|
is executed.
|
||||||
If
|
If
|
||||||
.Ic in
|
.Ic in
|
||||||
is not used to specify a word list, the positional parameters ($1, $2, etc.\&)
|
is not used to specify a word list, the positional parameters
|
||||||
|
.Po
|
||||||
|
.Va $1 , $2 ,
|
||||||
|
etc.\&
|
||||||
|
.Pc
|
||||||
are used instead.
|
are used instead.
|
||||||
For historical reasons, open and close braces may be used instead of
|
For historical reasons, open and close braces may be used instead of
|
||||||
.Ic do
|
.Ic do
|
||||||
@ -624,7 +637,7 @@ that is executed; if no non-conditional
|
|||||||
.Ar list
|
.Ar list
|
||||||
is executed, the exit status is zero.
|
is executed, the exit status is zero.
|
||||||
.It Xo Ic select Ar name No [
|
.It Xo Ic select Ar name No [
|
||||||
.Ic in Ar word Ar ... term Ns ]
|
.Ic in Ar word ... term Ns ]
|
||||||
.Ic do Ar list Ic done
|
.Ic do Ar list Ic done
|
||||||
.Xc
|
.Xc
|
||||||
The
|
The
|
||||||
@ -662,8 +675,10 @@ is read, an interrupt is received, or a
|
|||||||
.Ic break
|
.Ic break
|
||||||
statement is executed inside the loop.
|
statement is executed inside the loop.
|
||||||
If
|
If
|
||||||
.Ic in Ar word Ar ...
|
.Ic in Ar word ...\&
|
||||||
is omitted, the positional parameters are used (i.e., $1, $2, etc.).
|
is omitted, the positional parameters are used (i.e.,
|
||||||
|
.Va $1 , $2 ,
|
||||||
|
etc.).
|
||||||
For historical reasons, open and close braces may be used instead of
|
For historical reasons, open and close braces may be used instead of
|
||||||
.Ic do
|
.Ic do
|
||||||
and
|
and
|
||||||
@ -1246,7 +1261,9 @@ set directly using assignments:
|
|||||||
Process ID of the last background process started.
|
Process ID of the last background process started.
|
||||||
If no background processes have been started, the parameter is not set.
|
If no background processes have been started, the parameter is not set.
|
||||||
.It Ev \&#
|
.It Ev \&#
|
||||||
The number of positional parameters (i.e., $1, $2, etc.).
|
The number of positional parameters (i.e.,
|
||||||
|
.Va $1 , $2 ,
|
||||||
|
etc.).
|
||||||
.It Ev \&$
|
.It Ev \&$
|
||||||
The process ID of the shell, or the
|
The process ID of the shell, or the
|
||||||
.Tn PID
|
.Tn PID
|
||||||
@ -1257,9 +1274,9 @@ use this mechanism for generating temporary file names; see
|
|||||||
.Xr mktemp 1
|
.Xr mktemp 1
|
||||||
instead.
|
instead.
|
||||||
.It Ev \&-
|
.It Ev \&-
|
||||||
The concatenation of the current single letter options (see
|
The concatenation of the current single letter options (see the
|
||||||
.Ic set
|
.Ic set
|
||||||
command below for list of options).
|
command below for a list of options).
|
||||||
.It Ev \&?
|
.It Ev \&?
|
||||||
The exit status of the last non-asynchronous command executed.
|
The exit status of the last non-asynchronous command executed.
|
||||||
If the last command was killed by a signal,
|
If the last command was killed by a signal,
|
||||||
@ -1267,7 +1284,7 @@ If the last command was killed by a signal,
|
|||||||
is set to 128 plus the signal number.
|
is set to 128 plus the signal number.
|
||||||
.It Ev 0
|
.It Ev 0
|
||||||
The name the shell was invoked with (i.e.,
|
The name the shell was invoked with (i.e.,
|
||||||
.Ic argv[0] ) ,
|
.Li argv[0] ) ,
|
||||||
or the
|
or the
|
||||||
.Ar command-name
|
.Ar command-name
|
||||||
if it was invoked with the
|
if it was invoked with the
|
||||||
@ -1288,7 +1305,9 @@ or .-script.
|
|||||||
Further positional parameters may be accessed using
|
Further positional parameters may be accessed using
|
||||||
.Ic ${ Ns Ar number Ns Ic \&} .
|
.Ic ${ Ns Ar number Ns Ic \&} .
|
||||||
.It Ev \&*
|
.It Ev \&*
|
||||||
All positional parameters (except parameter 0), i.e., $1, $2, $3...
|
All positional parameters (except parameter 0); i.e.,
|
||||||
|
.Va $1 , $2 , $3 ,
|
||||||
|
\&...
|
||||||
If used
|
If used
|
||||||
outside of double quotes, parameters are separate words (which are subjected
|
outside of double quotes, parameters are separate words (which are subjected
|
||||||
to word splitting); if used within double quotes, parameters are separated
|
to word splitting); if used within double quotes, parameters are separated
|
||||||
@ -1350,11 +1369,11 @@ Currently set to the
|
|||||||
value as reported by
|
value as reported by
|
||||||
.Xr stty 1
|
.Xr stty 1
|
||||||
if that value is non-zero.
|
if that value is non-zero.
|
||||||
This parameter is used by the interactive line editing modes, and by
|
This parameter is used by the interactive line editing modes, and by the
|
||||||
.Ic select ,
|
.Ic select ,
|
||||||
.Ic set Fl o
|
.Ic set Fl o
|
||||||
and
|
and
|
||||||
.Ic kill -l
|
.Ic kill Fl l
|
||||||
commands to format information columns.
|
commands to format information columns.
|
||||||
.It Ev EDITOR
|
.It Ev EDITOR
|
||||||
If the
|
If the
|
||||||
@ -1508,7 +1527,7 @@ The primary prompt for interactive shells.
|
|||||||
Parameter, command, and arithmetic
|
Parameter, command, and arithmetic
|
||||||
substitutions are performed, and
|
substitutions are performed, and
|
||||||
.Ql \&!
|
.Ql \&!
|
||||||
is replaced with the current command number (see
|
is replaced with the current command number (see the
|
||||||
.Ic fc
|
.Ic fc
|
||||||
command below).
|
command below).
|
||||||
A literal
|
A literal
|
||||||
@ -1544,7 +1563,7 @@ statement when reading a menu selection.
|
|||||||
Default is
|
Default is
|
||||||
.Dq \&#\&?\ \& .
|
.Dq \&#\&?\ \& .
|
||||||
.It Ev PS4
|
.It Ev PS4
|
||||||
Used to prefix commands that are printed during execution tracing (see
|
Used to prefix commands that are printed during execution tracing (see the
|
||||||
.Ic set Fl x
|
.Ic set Fl x
|
||||||
command below).
|
command below).
|
||||||
Parameter, command, and arithmetic substitutions are performed
|
Parameter, command, and arithmetic substitutions are performed
|
||||||
@ -2353,7 +2372,7 @@ in
|
|||||||
.Pf non- Tn POSIX
|
.Pf non- Tn POSIX
|
||||||
mode.
|
mode.
|
||||||
To avoid problems, use the
|
To avoid problems, use the
|
||||||
.Ic $(...)
|
.Ic $(...)\&
|
||||||
form of command substitution.
|
form of command substitution.
|
||||||
.It
|
.It
|
||||||
.Ic kill -l
|
.Ic kill -l
|
||||||
@ -2455,7 +2474,7 @@ This construct is used in most shell scripts that use the old
|
|||||||
.Xr getopt 1
|
.Xr getopt 1
|
||||||
command.
|
command.
|
||||||
.It
|
.It
|
||||||
Argument expansion of
|
Argument expansion of the
|
||||||
.Ic alias ,
|
.Ic alias ,
|
||||||
.Ic export ,
|
.Ic export ,
|
||||||
.Ic readonly
|
.Ic readonly
|
||||||
@ -2542,7 +2561,7 @@ cause a non-interactive shell to exit and parameter assignments that are
|
|||||||
specified before the command are kept after the command completes.
|
specified before the command are kept after the command completes.
|
||||||
Just to confuse things, if the
|
Just to confuse things, if the
|
||||||
.Ic posix
|
.Ic posix
|
||||||
option is turned off (see
|
option is turned off (see the
|
||||||
.Ic set
|
.Ic set
|
||||||
command below), some special commands are very special in that no field
|
command below), some special commands are very special in that no field
|
||||||
splitting, file globbing, brace expansion, nor tilde expansion is performed
|
splitting, file globbing, brace expansion, nor tilde expansion is performed
|
||||||
@ -2679,11 +2698,11 @@ is assumed.
|
|||||||
This command is only available on systems which support job control (see
|
This command is only available on systems which support job control (see
|
||||||
.Sx Job control
|
.Sx Job control
|
||||||
below for more information).
|
below for more information).
|
||||||
.It Xo Ic bind Op Fl m
|
.It Xo
|
||||||
|
.Ic bind Op Fl m
|
||||||
.Oo Ar key
|
.Oo Ar key
|
||||||
.Op Ns = Ns Ar editing-command
|
.Op Ns = Ns Ar editing-command
|
||||||
.Ar ...
|
.Ar ... Oc
|
||||||
.Oc
|
|
||||||
.Xc
|
.Xc
|
||||||
Set or view the current emacs command editing key bindings/macros (see
|
Set or view the current emacs command editing key bindings/macros (see
|
||||||
.Sx Emacs editing mode
|
.Sx Emacs editing mode
|
||||||
@ -2738,7 +2757,7 @@ If the
|
|||||||
.Fl L
|
.Fl L
|
||||||
option (logical path) is used or if the
|
option (logical path) is used or if the
|
||||||
.Ic physical
|
.Ic physical
|
||||||
option (see
|
option (see the
|
||||||
.Ic set
|
.Ic set
|
||||||
command below) isn't set, references to
|
command below) isn't set, references to
|
||||||
.Dq \&.\&.
|
.Dq \&.\&.
|
||||||
@ -3146,7 +3165,7 @@ If the
|
|||||||
.Fl L
|
.Fl L
|
||||||
option is used or if the
|
option is used or if the
|
||||||
.Ic physical
|
.Ic physical
|
||||||
option (see
|
option (see the
|
||||||
.Ic set
|
.Ic set
|
||||||
command below) isn't set, the logical path is printed (i.e., the path used to
|
command below) isn't set, the logical path is printed (i.e., the path used to
|
||||||
.Ic cd
|
.Ic cd
|
||||||
@ -3244,7 +3263,9 @@ scripts.
|
|||||||
.Op Fl \&-
|
.Op Fl \&-
|
||||||
.Op Ar arg ...
|
.Op Ar arg ...
|
||||||
.Xc
|
.Xc
|
||||||
The set command can be used to set
|
The
|
||||||
|
.Ic set
|
||||||
|
command can be used to set
|
||||||
.Pq Ic \&-
|
.Pq Ic \&-
|
||||||
or clear
|
or clear
|
||||||
.Pq Ic \&+
|
.Pq Ic \&+
|
||||||
@ -3452,7 +3473,7 @@ In vi command-line editing, do command and file name completion when escape
|
|||||||
.It Ic vi-show8
|
.It Ic vi-show8
|
||||||
Prefix characters with the eighth bit set with
|
Prefix characters with the eighth bit set with
|
||||||
.Dq M\&- .
|
.Dq M\&- .
|
||||||
If this option is not set, characters in the range 128-160 are printed as is,
|
If this option is not set, characters in the range 128\-160 are printed as is,
|
||||||
which may cause problems.
|
which may cause problems.
|
||||||
.It Ic vi-tabcomplete
|
.It Ic vi-tabcomplete
|
||||||
In vi command-line editing, do command and file name completion when tab (^I)
|
In vi command-line editing, do command and file name completion when tab (^I)
|
||||||
@ -3583,7 +3604,7 @@ is a socket.
|
|||||||
.It Fl o Ar option
|
.It Fl o Ar option
|
||||||
Shell
|
Shell
|
||||||
.Ar option
|
.Ar option
|
||||||
is set (see
|
is set (see the
|
||||||
.Ic set
|
.Ic set
|
||||||
command above for a list of options).
|
command above for a list of options).
|
||||||
As a non-standard extension, if the option starts with a
|
As a non-standard extension, if the option starts with a
|
||||||
@ -3787,8 +3808,8 @@ is the name of a signal (e.g.,
|
|||||||
.Dv PIPE
|
.Dv PIPE
|
||||||
or
|
or
|
||||||
.Dv ALRM )
|
.Dv ALRM )
|
||||||
or the number of the signal (see
|
or the number of the signal (see the
|
||||||
.Ic kill -l
|
.Ic kill Fl l
|
||||||
command above).
|
command above).
|
||||||
There are two special signals:
|
There are two special signals:
|
||||||
.Dv EXIT
|
.Dv EXIT
|
||||||
@ -3799,7 +3820,7 @@ the shell to exit if the
|
|||||||
.Fl e
|
.Fl e
|
||||||
or
|
or
|
||||||
.Ic errexit
|
.Ic errexit
|
||||||
option were see -- see
|
option were see \(em see the
|
||||||
.Ic set
|
.Ic set
|
||||||
command above).
|
command above).
|
||||||
.Dv EXIT
|
.Dv EXIT
|
||||||
@ -3978,7 +3999,7 @@ Parameters (or functions) are placed in the environment of
|
|||||||
any executed commands.
|
any executed commands.
|
||||||
Exported functions are not yet implemented.
|
Exported functions are not yet implemented.
|
||||||
.El
|
.El
|
||||||
.It Xo Ic ulimit Op Fl acdfHlmnpsSt
|
.It Xo Ic ulimit Op Fl acdfHlmnpsStv
|
||||||
.Op Ar value
|
.Op Ar value
|
||||||
.Xc
|
.Xc
|
||||||
Display or set process limits.
|
Display or set process limits.
|
||||||
@ -4012,7 +4033,7 @@ blocks on the size of core dumps.
|
|||||||
.It Fl d Ar n
|
.It Fl d Ar n
|
||||||
Impose a size limit of
|
Impose a size limit of
|
||||||
.Ar n
|
.Ar n
|
||||||
kilobytes on the size of the data area.
|
kibibytes on the size of the data area.
|
||||||
.It Fl f Ar n
|
.It Fl f Ar n
|
||||||
Impose a size limit of
|
Impose a size limit of
|
||||||
.Ar n
|
.Ar n
|
||||||
@ -4021,11 +4042,11 @@ size may be read).
|
|||||||
.It Fl l Ar n
|
.It Fl l Ar n
|
||||||
Impose a limit of
|
Impose a limit of
|
||||||
.Ar n
|
.Ar n
|
||||||
kilobytes on the amount of locked (wired) physical memory.
|
kibibytes on the amount of locked (wired) physical memory.
|
||||||
.It Fl m Ar n
|
.It Fl m Ar n
|
||||||
Impose a limit of
|
Impose a limit of
|
||||||
.Ar n
|
.Ar n
|
||||||
kilobytes on the amount of physical memory used.
|
kibibytes on the amount of physical memory used.
|
||||||
.It Fl n Ar n
|
.It Fl n Ar n
|
||||||
Impose a limit of
|
Impose a limit of
|
||||||
.Ar n
|
.Ar n
|
||||||
@ -4037,7 +4058,7 @@ processes that can be run by the user at any one time.
|
|||||||
.It Fl s Ar n
|
.It Fl s Ar n
|
||||||
Impose a size limit of
|
Impose a size limit of
|
||||||
.Ar n
|
.Ar n
|
||||||
kilobytes on the size of the stack area.
|
kibibytes on the size of the stack area.
|
||||||
.It Fl t Ar n
|
.It Fl t Ar n
|
||||||
Impose a time limit of
|
Impose a time limit of
|
||||||
.Ar n
|
.Ar n
|
||||||
@ -4048,6 +4069,10 @@ Impose a real time limit of
|
|||||||
.Ar n
|
.Ar n
|
||||||
.Tn human
|
.Tn human
|
||||||
seconds to be used by each process.
|
seconds to be used by each process.
|
||||||
|
.It Fl v Ar n
|
||||||
|
Impose a limit of
|
||||||
|
.Ar n
|
||||||
|
kibibytes on the amount of virtual memory used.
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
As far as
|
As far as
|
||||||
@ -4197,7 +4222,7 @@ For interactive shells, this number is printed inside
|
|||||||
.Dq \&[..\&] ,
|
.Dq \&[..\&] ,
|
||||||
followed by the process IDs of the processes in the job when an asynchronous
|
followed by the process IDs of the processes in the job when an asynchronous
|
||||||
command is run.
|
command is run.
|
||||||
A job may be referred to in
|
A job may be referred to in the
|
||||||
.Ic bg ,
|
.Ic bg ,
|
||||||
.Ic fg ,
|
.Ic fg ,
|
||||||
.Ic jobs ,
|
.Ic jobs ,
|
||||||
@ -4694,15 +4719,17 @@ commands move in the opposite direction as the
|
|||||||
command.
|
command.
|
||||||
.It
|
.It
|
||||||
Commands which don't make sense in a single line editor are not available
|
Commands which don't make sense in a single line editor are not available
|
||||||
(e.g., screen movement command, ex-style
|
(e.g., screen movement commands,
|
||||||
.Ic \&:
|
.Xr ex 1 Ns -style
|
||||||
|
colon
|
||||||
|
.Pq Ic \&:
|
||||||
commands, etc.).
|
commands, etc.).
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
Note that the ^X stands for control-X; also <esc>, <space> and <tab> are used
|
Note that the ^X stands for control-X; also <esc>, <space> and <tab> are used
|
||||||
for escape, space, and tab, respectively (no kidding).
|
for escape, space, and tab, respectively (no kidding).
|
||||||
.Pp
|
.Pp
|
||||||
Like vi, there are two modes --
|
Like vi, there are two modes \(em
|
||||||
.Dq insert
|
.Dq insert
|
||||||
mode and
|
mode and
|
||||||
.Dq command
|
.Dq command
|
||||||
@ -5220,7 +5247,7 @@ can be obtained from \fBftp://ftp.cs.mun.ca/pub/pdksh\fR.
|
|||||||
.Pp
|
.Pp
|
||||||
By the way, the most frequently reported bug is:
|
By the way, the most frequently reported bug is:
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
echo hi | read a; echo $a\ \ \ # Does not print hi
|
$ echo hi | read a; echo $a # Does not print hi
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
The
|
The
|
||||||
|
7
main.c
7
main.c
@ -1,5 +1,5 @@
|
|||||||
/* $MirBSD: main.c,v 1.8 2004/05/24 19:56:16 tg Exp $ */
|
/** $MirBSD: main.c,v 1.9 2004/08/27 14:08:35 tg Stab $ */
|
||||||
/* $OpenBSD: main.c,v 1.26 2004/01/08 05:43:14 jmc Exp $ */
|
/* $OpenBSD: main.c,v 1.28 2004/08/23 14:56:32 millert Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* startup, main loop, environments and error handling
|
* startup, main loop, environments and error handling
|
||||||
@ -734,7 +734,8 @@ quitenv()
|
|||||||
* Don't do it for SIGQUIT, since we'd
|
* Don't do it for SIGQUIT, since we'd
|
||||||
* dump a core..
|
* dump a core..
|
||||||
*/
|
*/
|
||||||
if (sig == SIGINT || sig == SIGTERM) {
|
if ((sig == SIGINT || sig == SIGTERM) &&
|
||||||
|
getpgrp() == kshpid) {
|
||||||
setsig(&sigtraps[sig], SIG_DFL,
|
setsig(&sigtraps[sig], SIG_DFL,
|
||||||
SS_RESTORE_CURR|SS_FORCE);
|
SS_RESTORE_CURR|SS_FORCE);
|
||||||
kill(0, sig);
|
kill(0, sig);
|
||||||
|
10
sh.h
10
sh.h
@ -1,5 +1,10 @@
|
|||||||
/* $MirBSD: sh.h,v 1.9 2004/05/24 19:56:17 tg Exp $ */
|
/** $MirBSD: sh.h,v 1.10 2004/08/27 14:08:36 tg Exp $ */
|
||||||
/* $OpenBSD: sh.h,v 1.17 2004/05/10 16:28:47 pvalchev Exp $ */
|
/* $OpenBSD: sh.h,v 1.18 2004/05/31 10:36:35 otto Exp $ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Public Domain Bourne/Korn shell
|
||||||
|
*/
|
||||||
|
|
||||||
/* $From: sh.h,v 1.2 1994/05/19 18:32:40 michael Exp michael $ */
|
/* $From: sh.h,v 1.2 1994/05/19 18:32:40 michael Exp michael $ */
|
||||||
|
|
||||||
#include "config.h" /* system and option configuration info */
|
#include "config.h" /* system and option configuration info */
|
||||||
@ -111,7 +116,6 @@ void *memmove ARGS((void *d, const void *s, size_t n));
|
|||||||
#endif /* HAVE_PROTOTYPES */
|
#endif /* HAVE_PROTOTYPES */
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
extern int errno;
|
|
||||||
|
|
||||||
#ifdef HAVE_FCNTL_H
|
#ifdef HAVE_FCNTL_H
|
||||||
# include <fcntl.h>
|
# include <fcntl.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user