[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Making $! and $? searchable in the man page
From: |
Vidar Holen |
Subject: |
Making $! and $? searchable in the man page |
Date: |
Thu, 6 Jan 2011 10:48:33 +0100 (CET) |
User-agent: |
SquirrelMail/1.4.15 |
Hi,
Finding the meaning of $? and $! in the man page is quite hard for people
not familiar with the layout and bash terminology (this frequently comes
up in Freenode #bash). It would be very helpful for them if you could
simply search for "$!" to find the description of the parameter !.
Below is a suggestion patch that just adds a $ in front of the parameters
under Special Parameters to make this possible.
PS: I'm not on the list.
Vidar
diff -rup bash-4.1/doc/bash.1 bash-4.1-new/doc/bash.1
--- bash-4.1/doc/bash.1 2009-12-30 19:01:31.000000000 +0100
+++ bash-4.1-new/doc/bash.1 2011-01-06 10:19:06.000000000 +0100
@@ -1231,7 +1231,7 @@ The shell treats several parameters spec
only be referenced; assignment to them is not allowed.
.PD 0
.TP
-.B *
+.B $*
Expands to the positional parameters, starting from one. When the
expansion occurs within double quotes, it expands to a single word
with the value of each parameter separated by the first character
@@ -1253,7 +1253,7 @@ If
.B IFS
is null, the parameters are joined without intervening separators.
.TP
-.B @
+.B $@
Expands to the positional parameters, starting from one. When the
expansion occurs within double quotes, each parameter expands to a
separate word. That is, "\fB$@\fP" is equivalent to
@@ -1266,14 +1266,14 @@ When there are no positional parameters,
.B $@
expand to nothing (i.e., they are removed).
.TP
-.B #
+.B $#
Expands to the number of positional parameters in decimal.
.TP
-.B ?
+.B $?
Expands to the exit status of the most recently executed foreground
pipeline.
.TP
-.B \-
+.B $\-
Expands to the current option flags as specified upon invocation,
by the
.B set
@@ -1282,16 +1282,16 @@ builtin command, or those set by the she
.B \-i
option).
.TP
-.B $
+.B $$
Expands to the process ID of the shell. In a () subshell, it
expands to the process ID of the current shell, not the
subshell.
.TP
-.B !
+.B $!
Expands to the process ID of the most recently executed background
(asynchronous) command.
.TP
-.B 0
+.B $0
Expands to the name of the shell or shell script. This is set at
shell initialization. If
.B bash
@@ -1309,7 +1309,7 @@ to the file name used to invoke
.BR bash ,
as given by argument zero.
.TP
-.B _
+.B $_
At shell startup, set to the absolute pathname used to invoke the
shell or shell script being executed as passed in the environment
or argument list.
- Making $! and $? searchable in the man page,
Vidar Holen <=