mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-27 15:43:18 +02:00
commit bash-20170825 snapshot
This commit is contained in:
@@ -713,6 +713,8 @@ examples/functions/arrayops.bash f
|
||||
examples/functions/autoload f
|
||||
examples/functions/autoload.v2 f
|
||||
examples/functions/autoload.v3 f
|
||||
examples/functions/autoload.v4 f
|
||||
examples/functions/autoload.v4.t f
|
||||
examples/functions/basename f
|
||||
#examples/functions/basename2 f
|
||||
#examples/functions/coproc.bash f
|
||||
|
||||
+2207
-2204
File diff suppressed because it is too large
Load Diff
@@ -8181,6 +8181,7 @@ unless the
|
||||
shell option
|
||||
is enabled. In that case, it returns failure.
|
||||
An interactive shell returns failure if the file cannot be executed.
|
||||
A subshell exits unconditionally if \fBexec\fP fails.
|
||||
If
|
||||
.I command
|
||||
is not specified, any redirections take effect in the current shell,
|
||||
|
||||
+8
-5
@@ -139,7 +139,8 @@ If the
|
||||
option is present, or if no arguments remain after option
|
||||
processing, then commands are read from the standard input.
|
||||
This option allows the positional parameters to be set
|
||||
when invoking an interactive shell.
|
||||
when invoking an interactive shell or when reading input
|
||||
through a pipe.
|
||||
<DT><B>-D</B>
|
||||
|
||||
<DD>
|
||||
@@ -7896,8 +7897,9 @@ A synonym for <B>yank-last-arg</B>.
|
||||
|
||||
<DD>
|
||||
Accept the current line for execution and fetch the next line
|
||||
relative to the current line from the history for editing. Any
|
||||
argument is ignored.
|
||||
relative to the current line from the history for editing.
|
||||
A numeric argument, if supplied, specifies the history entry to use instead
|
||||
of the current line.
|
||||
<DT><B>edit-and-execute-command (C-x C-e)</B>
|
||||
|
||||
<DD>
|
||||
@@ -9222,7 +9224,7 @@ accepts
|
||||
<B>--</B>
|
||||
|
||||
to signify the end of the options.
|
||||
The <B>:</B>, <B>true</B>, <B>false</B>, and <B>test</B> builtins
|
||||
The <B>:</B>, <B>true</B>, <B>false</B>, and <B>test</B>/<B>[</B> builtins
|
||||
do not accept options and do not treat <B>--</B> specially.
|
||||
The <B>exit</B>, <B>logout</B>, <B>return</B>,
|
||||
<B>break</B>, <B>continue</B>, <B>let</B>,
|
||||
@@ -10396,6 +10398,7 @@ unless the
|
||||
shell option
|
||||
is enabled. In that case, it returns failure.
|
||||
An interactive shell returns failure if the file cannot be executed.
|
||||
A subshell exits unconditionally if <B>exec</B> fails.
|
||||
If
|
||||
<I>command</I>
|
||||
|
||||
@@ -13854,6 +13857,6 @@ There may be only one active coprocess at a time.
|
||||
</DL>
|
||||
<HR>
|
||||
This document was created by man2html from bash.1.<BR>
|
||||
Time: 26 June 2017 09:16:53 EDT
|
||||
Time: 23 August 2017 16:02:54 EDT
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
+137
-135
@@ -1,4 +1,4 @@
|
||||
This is bash.info, produced by makeinfo version 6.3 from
|
||||
This is bash.info, produced by makeinfo version 6.4 from
|
||||
bashref.texi.
|
||||
|
||||
This text is a brief description of the features that are present in the
|
||||
@@ -1725,7 +1725,7 @@ omitted, the operator tests only for existence.
|
||||
$ echo ${string:7}
|
||||
7890abcdefgh
|
||||
$ echo ${string:7:0}
|
||||
|
||||
|
||||
$ echo ${string:7:2}
|
||||
78
|
||||
$ echo ${string:7:-2}
|
||||
@@ -1733,7 +1733,7 @@ omitted, the operator tests only for existence.
|
||||
$ echo ${string: -7}
|
||||
bcdefgh
|
||||
$ echo ${string: -7:0}
|
||||
|
||||
|
||||
$ echo ${string: -7:2}
|
||||
bc
|
||||
$ echo ${string: -7:-2}
|
||||
@@ -1742,7 +1742,7 @@ omitted, the operator tests only for existence.
|
||||
$ echo ${1:7}
|
||||
7890abcdefgh
|
||||
$ echo ${1:7:0}
|
||||
|
||||
|
||||
$ echo ${1:7:2}
|
||||
78
|
||||
$ echo ${1:7:-2}
|
||||
@@ -1750,7 +1750,7 @@ omitted, the operator tests only for existence.
|
||||
$ echo ${1: -7}
|
||||
bcdefgh
|
||||
$ echo ${1: -7:0}
|
||||
|
||||
|
||||
$ echo ${1: -7:2}
|
||||
bc
|
||||
$ echo ${1: -7:-2}
|
||||
@@ -1759,7 +1759,7 @@ omitted, the operator tests only for existence.
|
||||
$ echo ${array[0]:7}
|
||||
7890abcdefgh
|
||||
$ echo ${array[0]:7:0}
|
||||
|
||||
|
||||
$ echo ${array[0]:7:2}
|
||||
78
|
||||
$ echo ${array[0]:7:-2}
|
||||
@@ -1767,7 +1767,7 @@ omitted, the operator tests only for existence.
|
||||
$ echo ${array[0]: -7}
|
||||
bcdefgh
|
||||
$ echo ${array[0]: -7:0}
|
||||
|
||||
|
||||
$ echo ${array[0]: -7:2}
|
||||
bc
|
||||
$ echo ${array[0]: -7:-2}
|
||||
@@ -1786,7 +1786,7 @@ omitted, the operator tests only for existence.
|
||||
$ echo ${@:7}
|
||||
7 8 9 0 a b c d e f g h
|
||||
$ echo ${@:7:0}
|
||||
|
||||
|
||||
$ echo ${@:7:2}
|
||||
7 8
|
||||
$ echo ${@:7:-2}
|
||||
@@ -1798,7 +1798,7 @@ omitted, the operator tests only for existence.
|
||||
$ echo ${@:0:2}
|
||||
./bash 1
|
||||
$ echo ${@: -7:0}
|
||||
|
||||
|
||||
|
||||
If PARAMETER is an indexed array name subscripted by '@' or '*',
|
||||
the result is the LENGTH members of the array beginning with
|
||||
@@ -1823,7 +1823,7 @@ omitted, the operator tests only for existence.
|
||||
$ echo ${array[@]:0:2}
|
||||
0 1
|
||||
$ echo ${array[@]: -7:0}
|
||||
|
||||
|
||||
|
||||
Substring expansion applied to an associative array produces
|
||||
undefined results.
|
||||
@@ -2848,13 +2848,13 @@ Completion Builtins::).
|
||||
|
||||
Unless otherwise noted, each builtin command documented as accepting
|
||||
options preceded by '-' accepts '--' to signify the end of the options.
|
||||
The ':', 'true', 'false', and 'test' builtins do not accept options and
|
||||
do not treat '--' specially. The 'exit', 'logout', 'return', 'break',
|
||||
'continue', 'let', and 'shift' builtins accept and process arguments
|
||||
beginning with '-' without requiring '--'. Other builtins that accept
|
||||
arguments but are not specified as accepting options interpret arguments
|
||||
beginning with '-' as invalid options and require '--' to prevent this
|
||||
interpretation.
|
||||
The ':', 'true', 'false', and 'test'/'[' builtins do not accept options
|
||||
and do not treat '--' specially. The 'exit', 'logout', 'return',
|
||||
'break', 'continue', 'let', and 'shift' builtins accept and process
|
||||
arguments beginning with '-' without requiring '--'. Other builtins
|
||||
that accept arguments but are not specified as accepting options
|
||||
interpret arguments beginning with '-' as invalid options and require
|
||||
'--' to prevent this interpretation.
|
||||
|
||||
|
||||
File: bash.info, Node: Bourne Shell Builtins, Next: Bash Builtins, Up: Shell Builtin Commands
|
||||
@@ -2969,10 +2969,11 @@ standard.
|
||||
If COMMAND cannot be executed for some reason, a non-interactive
|
||||
shell exits, unless the 'execfail' shell option is enabled. In
|
||||
that case, it returns failure. An interactive shell returns
|
||||
failure if the file cannot be executed. If no COMMAND is
|
||||
specified, redirections may be used to affect the current shell
|
||||
environment. If there are no redirection errors, the return status
|
||||
is zero; otherwise the return status is non-zero.
|
||||
failure if the file cannot be executed. A subshell exits
|
||||
unconditionally if 'exec' fails. If no COMMAND is specified,
|
||||
redirections may be used to affect the current shell environment.
|
||||
If there are no redirection errors, the return status is zero;
|
||||
otherwise the return status is non-zero.
|
||||
|
||||
'exit'
|
||||
exit [N]
|
||||
@@ -5558,7 +5559,7 @@ invocation which are not available with the 'set' builtin.
|
||||
If this option is present, or if no arguments remain after option
|
||||
processing, then commands are read from the standard input. This
|
||||
option allows the positional parameters to be set when invoking an
|
||||
interactive shell.
|
||||
interactive shell or when reading input through a pipe.
|
||||
|
||||
'-D'
|
||||
A list of all double-quoted strings preceded by '$' is printed on
|
||||
@@ -8482,8 +8483,9 @@ File: bash.info, Node: Miscellaneous Commands, Prev: Keyboard Macros, Up: Bin
|
||||
|
||||
'operate-and-get-next (C-o)'
|
||||
Accept the current line for execution and fetch the next line
|
||||
relative to the current line from the history for editing. Any
|
||||
argument is ignored.
|
||||
relative to the current line from the history for editing. A
|
||||
numeric argument, if supplied, specifies the history entry to use
|
||||
instead of the current line.
|
||||
|
||||
'edit-and-execute-command (C-x C-e)'
|
||||
Invoke an editor on the current command line, and execute the
|
||||
@@ -10781,7 +10783,7 @@ D.1 Index of Shell Builtin Commands
|
||||
* :: Bourne Shell Builtins.
|
||||
(line 11)
|
||||
* [: Bourne Shell Builtins.
|
||||
(line 268)
|
||||
(line 269)
|
||||
* alias: Bash Builtins. (line 11)
|
||||
* bg: Job Control Builtins.
|
||||
(line 7)
|
||||
@@ -10813,17 +10815,17 @@ D.1 Index of Shell Builtin Commands
|
||||
* exec: Bourne Shell Builtins.
|
||||
(line 102)
|
||||
* exit: Bourne Shell Builtins.
|
||||
(line 119)
|
||||
(line 120)
|
||||
* export: Bourne Shell Builtins.
|
||||
(line 126)
|
||||
(line 127)
|
||||
* fc: Bash History Builtins.
|
||||
(line 10)
|
||||
* fg: Job Control Builtins.
|
||||
(line 17)
|
||||
* getopts: Bourne Shell Builtins.
|
||||
(line 142)
|
||||
(line 143)
|
||||
* hash: Bourne Shell Builtins.
|
||||
(line 185)
|
||||
(line 186)
|
||||
* help: Bash Builtins. (line 323)
|
||||
* history: Bash History Builtins.
|
||||
(line 40)
|
||||
@@ -10841,34 +10843,34 @@ D.1 Index of Shell Builtin Commands
|
||||
* pushd: Directory Stack Builtins.
|
||||
(line 53)
|
||||
* pwd: Bourne Shell Builtins.
|
||||
(line 205)
|
||||
(line 206)
|
||||
* read: Bash Builtins. (line 459)
|
||||
* readarray: Bash Builtins. (line 553)
|
||||
* readonly: Bourne Shell Builtins.
|
||||
(line 215)
|
||||
(line 216)
|
||||
* return: Bourne Shell Builtins.
|
||||
(line 234)
|
||||
(line 235)
|
||||
* set: The Set Builtin. (line 11)
|
||||
* shift: Bourne Shell Builtins.
|
||||
(line 255)
|
||||
(line 256)
|
||||
* shopt: The Shopt Builtin. (line 9)
|
||||
* source: Bash Builtins. (line 562)
|
||||
* suspend: Job Control Builtins.
|
||||
(line 104)
|
||||
* test: Bourne Shell Builtins.
|
||||
(line 268)
|
||||
(line 269)
|
||||
* times: Bourne Shell Builtins.
|
||||
(line 343)
|
||||
(line 344)
|
||||
* trap: Bourne Shell Builtins.
|
||||
(line 349)
|
||||
(line 350)
|
||||
* type: Bash Builtins. (line 567)
|
||||
* typeset: Bash Builtins. (line 599)
|
||||
* ulimit: Bash Builtins. (line 605)
|
||||
* umask: Bourne Shell Builtins.
|
||||
(line 398)
|
||||
(line 399)
|
||||
* unalias: Bash Builtins. (line 704)
|
||||
* unset: Bourne Shell Builtins.
|
||||
(line 416)
|
||||
(line 417)
|
||||
* wait: Job Control Builtins.
|
||||
(line 76)
|
||||
|
||||
@@ -11215,7 +11217,7 @@ D.4 Function Index
|
||||
* dynamic-complete-history (M-<TAB>): Commands For Completion.
|
||||
(line 90)
|
||||
* edit-and-execute-command (C-x C-e): Miscellaneous Commands.
|
||||
(line 139)
|
||||
(line 140)
|
||||
* end-kbd-macro (C-x )): Keyboard Macros. (line 9)
|
||||
* end-of-file (usually C-d): Commands For Text. (line 6)
|
||||
* end-of-history (M->): Commands For History.
|
||||
@@ -11534,101 +11536,101 @@ Node: Shell Expansions63212
|
||||
Node: Brace Expansion65335
|
||||
Node: Tilde Expansion68169
|
||||
Node: Shell Parameter Expansion70517
|
||||
Node: Command Substitution84649
|
||||
Node: Arithmetic Expansion86004
|
||||
Node: Process Substitution86936
|
||||
Node: Word Splitting88056
|
||||
Node: Filename Expansion90000
|
||||
Node: Pattern Matching92374
|
||||
Node: Quote Removal96360
|
||||
Node: Redirections96655
|
||||
Node: Executing Commands106213
|
||||
Node: Simple Command Expansion106883
|
||||
Node: Command Search and Execution108813
|
||||
Node: Command Execution Environment111149
|
||||
Node: Environment114133
|
||||
Node: Exit Status115792
|
||||
Node: Signals117462
|
||||
Node: Shell Scripts119429
|
||||
Node: Shell Builtin Commands121944
|
||||
Node: Bourne Shell Builtins123978
|
||||
Node: Bash Builtins144578
|
||||
Node: Modifying Shell Behavior173487
|
||||
Node: The Set Builtin173832
|
||||
Node: The Shopt Builtin184245
|
||||
Node: Special Builtins200580
|
||||
Node: Shell Variables201559
|
||||
Node: Bourne Shell Variables201996
|
||||
Node: Bash Variables204100
|
||||
Node: Bash Features233893
|
||||
Node: Invoking Bash234792
|
||||
Node: Bash Startup Files240741
|
||||
Node: Interactive Shells245844
|
||||
Node: What is an Interactive Shell?246254
|
||||
Node: Is this Shell Interactive?246903
|
||||
Node: Interactive Shell Behavior247718
|
||||
Node: Bash Conditional Expressions251206
|
||||
Node: Shell Arithmetic255572
|
||||
Node: Aliases258389
|
||||
Node: Arrays260937
|
||||
Node: The Directory Stack266099
|
||||
Node: Directory Stack Builtins266883
|
||||
Node: Controlling the Prompt269851
|
||||
Node: The Restricted Shell272613
|
||||
Node: Bash POSIX Mode274438
|
||||
Node: Job Control284789
|
||||
Node: Job Control Basics285249
|
||||
Node: Job Control Builtins290217
|
||||
Node: Job Control Variables294944
|
||||
Node: Command Line Editing296100
|
||||
Node: Introduction and Notation297771
|
||||
Node: Readline Interaction299394
|
||||
Node: Readline Bare Essentials300585
|
||||
Node: Readline Movement Commands302368
|
||||
Node: Readline Killing Commands303328
|
||||
Node: Readline Arguments305246
|
||||
Node: Searching306290
|
||||
Node: Readline Init File308476
|
||||
Node: Readline Init File Syntax309623
|
||||
Node: Conditional Init Constructs329810
|
||||
Node: Sample Init File332335
|
||||
Node: Bindable Readline Commands335452
|
||||
Node: Commands For Moving336656
|
||||
Node: Commands For History338505
|
||||
Node: Commands For Text342800
|
||||
Node: Commands For Killing346189
|
||||
Node: Numeric Arguments348670
|
||||
Node: Commands For Completion349809
|
||||
Node: Keyboard Macros354000
|
||||
Node: Miscellaneous Commands354687
|
||||
Node: Readline vi Mode360563
|
||||
Node: Programmable Completion361470
|
||||
Node: Programmable Completion Builtins368931
|
||||
Node: A Programmable Completion Example378817
|
||||
Node: Using History Interactively384068
|
||||
Node: Bash History Facilities384752
|
||||
Node: Bash History Builtins387753
|
||||
Node: History Interaction392045
|
||||
Node: Event Designators395009
|
||||
Node: Word Designators396228
|
||||
Node: Modifiers397865
|
||||
Node: Installing Bash399267
|
||||
Node: Basic Installation400404
|
||||
Node: Compilers and Options403095
|
||||
Node: Compiling For Multiple Architectures403836
|
||||
Node: Installation Names405499
|
||||
Node: Specifying the System Type406317
|
||||
Node: Sharing Defaults407033
|
||||
Node: Operation Controls407706
|
||||
Node: Optional Features408664
|
||||
Node: Reporting Bugs419190
|
||||
Node: Major Differences From The Bourne Shell420384
|
||||
Node: GNU Free Documentation License437236
|
||||
Node: Indexes462413
|
||||
Node: Builtin Index462867
|
||||
Node: Reserved Word Index469694
|
||||
Node: Variable Index472142
|
||||
Node: Function Index487820
|
||||
Node: Concept Index501123
|
||||
Node: Command Substitution84694
|
||||
Node: Arithmetic Expansion86049
|
||||
Node: Process Substitution86981
|
||||
Node: Word Splitting88101
|
||||
Node: Filename Expansion90045
|
||||
Node: Pattern Matching92419
|
||||
Node: Quote Removal96405
|
||||
Node: Redirections96700
|
||||
Node: Executing Commands106258
|
||||
Node: Simple Command Expansion106928
|
||||
Node: Command Search and Execution108858
|
||||
Node: Command Execution Environment111194
|
||||
Node: Environment114178
|
||||
Node: Exit Status115837
|
||||
Node: Signals117507
|
||||
Node: Shell Scripts119474
|
||||
Node: Shell Builtin Commands121989
|
||||
Node: Bourne Shell Builtins124027
|
||||
Node: Bash Builtins144682
|
||||
Node: Modifying Shell Behavior173591
|
||||
Node: The Set Builtin173936
|
||||
Node: The Shopt Builtin184349
|
||||
Node: Special Builtins200684
|
||||
Node: Shell Variables201663
|
||||
Node: Bourne Shell Variables202100
|
||||
Node: Bash Variables204204
|
||||
Node: Bash Features233997
|
||||
Node: Invoking Bash234896
|
||||
Node: Bash Startup Files240882
|
||||
Node: Interactive Shells245985
|
||||
Node: What is an Interactive Shell?246395
|
||||
Node: Is this Shell Interactive?247044
|
||||
Node: Interactive Shell Behavior247859
|
||||
Node: Bash Conditional Expressions251347
|
||||
Node: Shell Arithmetic255713
|
||||
Node: Aliases258530
|
||||
Node: Arrays261078
|
||||
Node: The Directory Stack266240
|
||||
Node: Directory Stack Builtins267024
|
||||
Node: Controlling the Prompt269992
|
||||
Node: The Restricted Shell272754
|
||||
Node: Bash POSIX Mode274579
|
||||
Node: Job Control284930
|
||||
Node: Job Control Basics285390
|
||||
Node: Job Control Builtins290358
|
||||
Node: Job Control Variables295085
|
||||
Node: Command Line Editing296241
|
||||
Node: Introduction and Notation297912
|
||||
Node: Readline Interaction299535
|
||||
Node: Readline Bare Essentials300726
|
||||
Node: Readline Movement Commands302509
|
||||
Node: Readline Killing Commands303469
|
||||
Node: Readline Arguments305387
|
||||
Node: Searching306431
|
||||
Node: Readline Init File308617
|
||||
Node: Readline Init File Syntax309764
|
||||
Node: Conditional Init Constructs329951
|
||||
Node: Sample Init File332476
|
||||
Node: Bindable Readline Commands335593
|
||||
Node: Commands For Moving336797
|
||||
Node: Commands For History338646
|
||||
Node: Commands For Text342941
|
||||
Node: Commands For Killing346330
|
||||
Node: Numeric Arguments348811
|
||||
Node: Commands For Completion349950
|
||||
Node: Keyboard Macros354141
|
||||
Node: Miscellaneous Commands354828
|
||||
Node: Readline vi Mode360781
|
||||
Node: Programmable Completion361688
|
||||
Node: Programmable Completion Builtins369149
|
||||
Node: A Programmable Completion Example379035
|
||||
Node: Using History Interactively384286
|
||||
Node: Bash History Facilities384970
|
||||
Node: Bash History Builtins387971
|
||||
Node: History Interaction392263
|
||||
Node: Event Designators395227
|
||||
Node: Word Designators396446
|
||||
Node: Modifiers398083
|
||||
Node: Installing Bash399485
|
||||
Node: Basic Installation400622
|
||||
Node: Compilers and Options403313
|
||||
Node: Compiling For Multiple Architectures404054
|
||||
Node: Installation Names405717
|
||||
Node: Specifying the System Type406535
|
||||
Node: Sharing Defaults407251
|
||||
Node: Operation Controls407924
|
||||
Node: Optional Features408882
|
||||
Node: Reporting Bugs419408
|
||||
Node: Major Differences From The Bourne Shell420602
|
||||
Node: GNU Free Documentation License437454
|
||||
Node: Indexes462631
|
||||
Node: Builtin Index463085
|
||||
Node: Reserved Word Index469912
|
||||
Node: Variable Index472360
|
||||
Node: Function Index488038
|
||||
Node: Concept Index501341
|
||||
|
||||
End Tag Table
|
||||
|
||||
Binary file not shown.
+1847
-1842
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+10
-7
@@ -15,7 +15,7 @@ any later version published by the Free Software Foundation; with no
|
||||
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
|
||||
A copy of the license is included in the section entitled
|
||||
"GNU Free Documentation License". -->
|
||||
<!-- Created by GNU Texinfo 6.3, http://www.gnu.org/software/texinfo/ -->
|
||||
<!-- Created by GNU Texinfo 6.4, http://www.gnu.org/software/texinfo/ -->
|
||||
<head>
|
||||
<title>Bash Reference Manual</title>
|
||||
|
||||
@@ -3975,7 +3975,7 @@ facilities (see <a href="#Programmable-Completion-Builtins">Programmable Complet
|
||||
<p>Unless otherwise noted, each builtin command documented as accepting
|
||||
options preceded by ‘<samp>-</samp>’ accepts ‘<samp>--</samp>’
|
||||
to signify the end of the options.
|
||||
The <code>:</code>, <code>true</code>, <code>false</code>, and <code>test</code>
|
||||
The <code>:</code>, <code>true</code>, <code>false</code>, and <code>test</code>/<code>[</code>
|
||||
builtins do not accept options and do not treat ‘<samp>--</samp>’ specially.
|
||||
The <code>exit</code>, <code>logout</code>, <code>return</code>,
|
||||
<code>break</code>, <code>continue</code>, <code>let</code>,
|
||||
@@ -4142,6 +4142,7 @@ cannot be executed for some reason, a non-interactive shell exits,
|
||||
unless the <code>execfail</code> shell option
|
||||
is enabled. In that case, it returns failure.
|
||||
An interactive shell returns failure if the file cannot be executed.
|
||||
A subshell exits unconditionally if <code>exec</code> fails.
|
||||
If no <var>command</var> is specified, redirections may be used to affect
|
||||
the current shell environment. If there are no redirection errors, the
|
||||
return status is zero; otherwise the return status is non-zero.
|
||||
@@ -7682,7 +7683,8 @@ of a login shell.
|
||||
<dd><p>If this option is present, or if no arguments remain after option
|
||||
processing, then commands are read from the standard input.
|
||||
This option allows the positional parameters to be set
|
||||
when invoking an interactive shell.
|
||||
when invoking an interactive shell or when reading input
|
||||
through a pipe.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><code>-D</code></dt>
|
||||
@@ -11652,8 +11654,9 @@ word expansions (see <a href="#Shell-Expansions">Shell Expansions</a>).
|
||||
<a name="index-operate_002dand_002dget_002dnext-_0028C_002do_0029"></a>
|
||||
</dt>
|
||||
<dd><p>Accept the current line for execution and fetch the next line
|
||||
relative to the current line from the history for editing. Any
|
||||
argument is ignored.
|
||||
relative to the current line from the history for editing.
|
||||
A numeric argument, if supplied, specifies the history entry to use instead
|
||||
of the current line.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><code>edit-and-execute-command (C-x C-e)</code>
|
||||
@@ -13876,7 +13879,7 @@ Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
</pre></div>
|
||||
|
||||
<ol>
|
||||
<ol start="0">
|
||||
<li> PREAMBLE
|
||||
|
||||
<p>The purpose of this License is to make a manual, textbook, or other
|
||||
@@ -14052,7 +14055,7 @@ Version filling the role of the Document, thus licensing distribution
|
||||
and modification of the Modified Version to whoever possesses a copy
|
||||
of it. In addition, you must do these things in the Modified Version:
|
||||
</p>
|
||||
<ol>
|
||||
<ol type="A" start="1">
|
||||
<li> Use in the Title Page (and on the covers, if any) a title distinct
|
||||
from that of the Document, and from those of previous versions
|
||||
(which should, if there were any, be listed in the History section
|
||||
|
||||
+137
-135
@@ -1,4 +1,4 @@
|
||||
This is bashref.info, produced by makeinfo version 6.3 from
|
||||
This is bashref.info, produced by makeinfo version 6.4 from
|
||||
bashref.texi.
|
||||
|
||||
This text is a brief description of the features that are present in the
|
||||
@@ -1725,7 +1725,7 @@ omitted, the operator tests only for existence.
|
||||
$ echo ${string:7}
|
||||
7890abcdefgh
|
||||
$ echo ${string:7:0}
|
||||
|
||||
|
||||
$ echo ${string:7:2}
|
||||
78
|
||||
$ echo ${string:7:-2}
|
||||
@@ -1733,7 +1733,7 @@ omitted, the operator tests only for existence.
|
||||
$ echo ${string: -7}
|
||||
bcdefgh
|
||||
$ echo ${string: -7:0}
|
||||
|
||||
|
||||
$ echo ${string: -7:2}
|
||||
bc
|
||||
$ echo ${string: -7:-2}
|
||||
@@ -1742,7 +1742,7 @@ omitted, the operator tests only for existence.
|
||||
$ echo ${1:7}
|
||||
7890abcdefgh
|
||||
$ echo ${1:7:0}
|
||||
|
||||
|
||||
$ echo ${1:7:2}
|
||||
78
|
||||
$ echo ${1:7:-2}
|
||||
@@ -1750,7 +1750,7 @@ omitted, the operator tests only for existence.
|
||||
$ echo ${1: -7}
|
||||
bcdefgh
|
||||
$ echo ${1: -7:0}
|
||||
|
||||
|
||||
$ echo ${1: -7:2}
|
||||
bc
|
||||
$ echo ${1: -7:-2}
|
||||
@@ -1759,7 +1759,7 @@ omitted, the operator tests only for existence.
|
||||
$ echo ${array[0]:7}
|
||||
7890abcdefgh
|
||||
$ echo ${array[0]:7:0}
|
||||
|
||||
|
||||
$ echo ${array[0]:7:2}
|
||||
78
|
||||
$ echo ${array[0]:7:-2}
|
||||
@@ -1767,7 +1767,7 @@ omitted, the operator tests only for existence.
|
||||
$ echo ${array[0]: -7}
|
||||
bcdefgh
|
||||
$ echo ${array[0]: -7:0}
|
||||
|
||||
|
||||
$ echo ${array[0]: -7:2}
|
||||
bc
|
||||
$ echo ${array[0]: -7:-2}
|
||||
@@ -1786,7 +1786,7 @@ omitted, the operator tests only for existence.
|
||||
$ echo ${@:7}
|
||||
7 8 9 0 a b c d e f g h
|
||||
$ echo ${@:7:0}
|
||||
|
||||
|
||||
$ echo ${@:7:2}
|
||||
7 8
|
||||
$ echo ${@:7:-2}
|
||||
@@ -1798,7 +1798,7 @@ omitted, the operator tests only for existence.
|
||||
$ echo ${@:0:2}
|
||||
./bash 1
|
||||
$ echo ${@: -7:0}
|
||||
|
||||
|
||||
|
||||
If PARAMETER is an indexed array name subscripted by '@' or '*',
|
||||
the result is the LENGTH members of the array beginning with
|
||||
@@ -1823,7 +1823,7 @@ omitted, the operator tests only for existence.
|
||||
$ echo ${array[@]:0:2}
|
||||
0 1
|
||||
$ echo ${array[@]: -7:0}
|
||||
|
||||
|
||||
|
||||
Substring expansion applied to an associative array produces
|
||||
undefined results.
|
||||
@@ -2848,13 +2848,13 @@ Completion Builtins::).
|
||||
|
||||
Unless otherwise noted, each builtin command documented as accepting
|
||||
options preceded by '-' accepts '--' to signify the end of the options.
|
||||
The ':', 'true', 'false', and 'test' builtins do not accept options and
|
||||
do not treat '--' specially. The 'exit', 'logout', 'return', 'break',
|
||||
'continue', 'let', and 'shift' builtins accept and process arguments
|
||||
beginning with '-' without requiring '--'. Other builtins that accept
|
||||
arguments but are not specified as accepting options interpret arguments
|
||||
beginning with '-' as invalid options and require '--' to prevent this
|
||||
interpretation.
|
||||
The ':', 'true', 'false', and 'test'/'[' builtins do not accept options
|
||||
and do not treat '--' specially. The 'exit', 'logout', 'return',
|
||||
'break', 'continue', 'let', and 'shift' builtins accept and process
|
||||
arguments beginning with '-' without requiring '--'. Other builtins
|
||||
that accept arguments but are not specified as accepting options
|
||||
interpret arguments beginning with '-' as invalid options and require
|
||||
'--' to prevent this interpretation.
|
||||
|
||||
|
||||
File: bashref.info, Node: Bourne Shell Builtins, Next: Bash Builtins, Up: Shell Builtin Commands
|
||||
@@ -2969,10 +2969,11 @@ standard.
|
||||
If COMMAND cannot be executed for some reason, a non-interactive
|
||||
shell exits, unless the 'execfail' shell option is enabled. In
|
||||
that case, it returns failure. An interactive shell returns
|
||||
failure if the file cannot be executed. If no COMMAND is
|
||||
specified, redirections may be used to affect the current shell
|
||||
environment. If there are no redirection errors, the return status
|
||||
is zero; otherwise the return status is non-zero.
|
||||
failure if the file cannot be executed. A subshell exits
|
||||
unconditionally if 'exec' fails. If no COMMAND is specified,
|
||||
redirections may be used to affect the current shell environment.
|
||||
If there are no redirection errors, the return status is zero;
|
||||
otherwise the return status is non-zero.
|
||||
|
||||
'exit'
|
||||
exit [N]
|
||||
@@ -5558,7 +5559,7 @@ invocation which are not available with the 'set' builtin.
|
||||
If this option is present, or if no arguments remain after option
|
||||
processing, then commands are read from the standard input. This
|
||||
option allows the positional parameters to be set when invoking an
|
||||
interactive shell.
|
||||
interactive shell or when reading input through a pipe.
|
||||
|
||||
'-D'
|
||||
A list of all double-quoted strings preceded by '$' is printed on
|
||||
@@ -8482,8 +8483,9 @@ File: bashref.info, Node: Miscellaneous Commands, Prev: Keyboard Macros, Up:
|
||||
|
||||
'operate-and-get-next (C-o)'
|
||||
Accept the current line for execution and fetch the next line
|
||||
relative to the current line from the history for editing. Any
|
||||
argument is ignored.
|
||||
relative to the current line from the history for editing. A
|
||||
numeric argument, if supplied, specifies the history entry to use
|
||||
instead of the current line.
|
||||
|
||||
'edit-and-execute-command (C-x C-e)'
|
||||
Invoke an editor on the current command line, and execute the
|
||||
@@ -10781,7 +10783,7 @@ D.1 Index of Shell Builtin Commands
|
||||
* :: Bourne Shell Builtins.
|
||||
(line 11)
|
||||
* [: Bourne Shell Builtins.
|
||||
(line 268)
|
||||
(line 269)
|
||||
* alias: Bash Builtins. (line 11)
|
||||
* bg: Job Control Builtins.
|
||||
(line 7)
|
||||
@@ -10813,17 +10815,17 @@ D.1 Index of Shell Builtin Commands
|
||||
* exec: Bourne Shell Builtins.
|
||||
(line 102)
|
||||
* exit: Bourne Shell Builtins.
|
||||
(line 119)
|
||||
(line 120)
|
||||
* export: Bourne Shell Builtins.
|
||||
(line 126)
|
||||
(line 127)
|
||||
* fc: Bash History Builtins.
|
||||
(line 10)
|
||||
* fg: Job Control Builtins.
|
||||
(line 17)
|
||||
* getopts: Bourne Shell Builtins.
|
||||
(line 142)
|
||||
(line 143)
|
||||
* hash: Bourne Shell Builtins.
|
||||
(line 185)
|
||||
(line 186)
|
||||
* help: Bash Builtins. (line 323)
|
||||
* history: Bash History Builtins.
|
||||
(line 40)
|
||||
@@ -10841,34 +10843,34 @@ D.1 Index of Shell Builtin Commands
|
||||
* pushd: Directory Stack Builtins.
|
||||
(line 53)
|
||||
* pwd: Bourne Shell Builtins.
|
||||
(line 205)
|
||||
(line 206)
|
||||
* read: Bash Builtins. (line 459)
|
||||
* readarray: Bash Builtins. (line 553)
|
||||
* readonly: Bourne Shell Builtins.
|
||||
(line 215)
|
||||
(line 216)
|
||||
* return: Bourne Shell Builtins.
|
||||
(line 234)
|
||||
(line 235)
|
||||
* set: The Set Builtin. (line 11)
|
||||
* shift: Bourne Shell Builtins.
|
||||
(line 255)
|
||||
(line 256)
|
||||
* shopt: The Shopt Builtin. (line 9)
|
||||
* source: Bash Builtins. (line 562)
|
||||
* suspend: Job Control Builtins.
|
||||
(line 104)
|
||||
* test: Bourne Shell Builtins.
|
||||
(line 268)
|
||||
(line 269)
|
||||
* times: Bourne Shell Builtins.
|
||||
(line 343)
|
||||
(line 344)
|
||||
* trap: Bourne Shell Builtins.
|
||||
(line 349)
|
||||
(line 350)
|
||||
* type: Bash Builtins. (line 567)
|
||||
* typeset: Bash Builtins. (line 599)
|
||||
* ulimit: Bash Builtins. (line 605)
|
||||
* umask: Bourne Shell Builtins.
|
||||
(line 398)
|
||||
(line 399)
|
||||
* unalias: Bash Builtins. (line 704)
|
||||
* unset: Bourne Shell Builtins.
|
||||
(line 416)
|
||||
(line 417)
|
||||
* wait: Job Control Builtins.
|
||||
(line 76)
|
||||
|
||||
@@ -11215,7 +11217,7 @@ D.4 Function Index
|
||||
* dynamic-complete-history (M-<TAB>): Commands For Completion.
|
||||
(line 90)
|
||||
* edit-and-execute-command (C-x C-e): Miscellaneous Commands.
|
||||
(line 139)
|
||||
(line 140)
|
||||
* end-kbd-macro (C-x )): Keyboard Macros. (line 9)
|
||||
* end-of-file (usually C-d): Commands For Text. (line 6)
|
||||
* end-of-history (M->): Commands For History.
|
||||
@@ -11534,101 +11536,101 @@ Node: Shell Expansions63212
|
||||
Node: Brace Expansion65335
|
||||
Node: Tilde Expansion68169
|
||||
Node: Shell Parameter Expansion70517
|
||||
Node: Command Substitution84649
|
||||
Node: Arithmetic Expansion86004
|
||||
Node: Process Substitution86936
|
||||
Node: Word Splitting88056
|
||||
Node: Filename Expansion90000
|
||||
Node: Pattern Matching92374
|
||||
Node: Quote Removal96360
|
||||
Node: Redirections96655
|
||||
Node: Executing Commands106213
|
||||
Node: Simple Command Expansion106883
|
||||
Node: Command Search and Execution108813
|
||||
Node: Command Execution Environment111149
|
||||
Node: Environment114133
|
||||
Node: Exit Status115792
|
||||
Node: Signals117462
|
||||
Node: Shell Scripts119429
|
||||
Node: Shell Builtin Commands121944
|
||||
Node: Bourne Shell Builtins123978
|
||||
Node: Bash Builtins144578
|
||||
Node: Modifying Shell Behavior173487
|
||||
Node: The Set Builtin173832
|
||||
Node: The Shopt Builtin184245
|
||||
Node: Special Builtins200580
|
||||
Node: Shell Variables201559
|
||||
Node: Bourne Shell Variables201996
|
||||
Node: Bash Variables204100
|
||||
Node: Bash Features233893
|
||||
Node: Invoking Bash234792
|
||||
Node: Bash Startup Files240741
|
||||
Node: Interactive Shells245844
|
||||
Node: What is an Interactive Shell?246254
|
||||
Node: Is this Shell Interactive?246903
|
||||
Node: Interactive Shell Behavior247718
|
||||
Node: Bash Conditional Expressions251206
|
||||
Node: Shell Arithmetic255572
|
||||
Node: Aliases258389
|
||||
Node: Arrays260937
|
||||
Node: The Directory Stack266099
|
||||
Node: Directory Stack Builtins266883
|
||||
Node: Controlling the Prompt269851
|
||||
Node: The Restricted Shell272613
|
||||
Node: Bash POSIX Mode274438
|
||||
Node: Job Control284789
|
||||
Node: Job Control Basics285249
|
||||
Node: Job Control Builtins290217
|
||||
Node: Job Control Variables294944
|
||||
Node: Command Line Editing296100
|
||||
Node: Introduction and Notation297771
|
||||
Node: Readline Interaction299394
|
||||
Node: Readline Bare Essentials300585
|
||||
Node: Readline Movement Commands302368
|
||||
Node: Readline Killing Commands303328
|
||||
Node: Readline Arguments305246
|
||||
Node: Searching306290
|
||||
Node: Readline Init File308476
|
||||
Node: Readline Init File Syntax309623
|
||||
Node: Conditional Init Constructs329810
|
||||
Node: Sample Init File332335
|
||||
Node: Bindable Readline Commands335452
|
||||
Node: Commands For Moving336656
|
||||
Node: Commands For History338505
|
||||
Node: Commands For Text342800
|
||||
Node: Commands For Killing346189
|
||||
Node: Numeric Arguments348670
|
||||
Node: Commands For Completion349809
|
||||
Node: Keyboard Macros354000
|
||||
Node: Miscellaneous Commands354687
|
||||
Node: Readline vi Mode360563
|
||||
Node: Programmable Completion361470
|
||||
Node: Programmable Completion Builtins368931
|
||||
Node: A Programmable Completion Example378817
|
||||
Node: Using History Interactively384068
|
||||
Node: Bash History Facilities384752
|
||||
Node: Bash History Builtins387753
|
||||
Node: History Interaction392045
|
||||
Node: Event Designators395009
|
||||
Node: Word Designators396228
|
||||
Node: Modifiers397865
|
||||
Node: Installing Bash399267
|
||||
Node: Basic Installation400404
|
||||
Node: Compilers and Options403095
|
||||
Node: Compiling For Multiple Architectures403836
|
||||
Node: Installation Names405499
|
||||
Node: Specifying the System Type406317
|
||||
Node: Sharing Defaults407033
|
||||
Node: Operation Controls407706
|
||||
Node: Optional Features408664
|
||||
Node: Reporting Bugs419190
|
||||
Node: Major Differences From The Bourne Shell420384
|
||||
Node: GNU Free Documentation License437236
|
||||
Node: Indexes462413
|
||||
Node: Builtin Index462867
|
||||
Node: Reserved Word Index469694
|
||||
Node: Variable Index472142
|
||||
Node: Function Index487820
|
||||
Node: Concept Index501123
|
||||
Node: Command Substitution84694
|
||||
Node: Arithmetic Expansion86049
|
||||
Node: Process Substitution86981
|
||||
Node: Word Splitting88101
|
||||
Node: Filename Expansion90045
|
||||
Node: Pattern Matching92419
|
||||
Node: Quote Removal96405
|
||||
Node: Redirections96700
|
||||
Node: Executing Commands106258
|
||||
Node: Simple Command Expansion106928
|
||||
Node: Command Search and Execution108858
|
||||
Node: Command Execution Environment111194
|
||||
Node: Environment114178
|
||||
Node: Exit Status115837
|
||||
Node: Signals117507
|
||||
Node: Shell Scripts119474
|
||||
Node: Shell Builtin Commands121989
|
||||
Node: Bourne Shell Builtins124027
|
||||
Node: Bash Builtins144682
|
||||
Node: Modifying Shell Behavior173591
|
||||
Node: The Set Builtin173936
|
||||
Node: The Shopt Builtin184349
|
||||
Node: Special Builtins200684
|
||||
Node: Shell Variables201663
|
||||
Node: Bourne Shell Variables202100
|
||||
Node: Bash Variables204204
|
||||
Node: Bash Features233997
|
||||
Node: Invoking Bash234896
|
||||
Node: Bash Startup Files240882
|
||||
Node: Interactive Shells245985
|
||||
Node: What is an Interactive Shell?246395
|
||||
Node: Is this Shell Interactive?247044
|
||||
Node: Interactive Shell Behavior247859
|
||||
Node: Bash Conditional Expressions251347
|
||||
Node: Shell Arithmetic255713
|
||||
Node: Aliases258530
|
||||
Node: Arrays261078
|
||||
Node: The Directory Stack266240
|
||||
Node: Directory Stack Builtins267024
|
||||
Node: Controlling the Prompt269992
|
||||
Node: The Restricted Shell272754
|
||||
Node: Bash POSIX Mode274579
|
||||
Node: Job Control284930
|
||||
Node: Job Control Basics285390
|
||||
Node: Job Control Builtins290358
|
||||
Node: Job Control Variables295085
|
||||
Node: Command Line Editing296241
|
||||
Node: Introduction and Notation297912
|
||||
Node: Readline Interaction299535
|
||||
Node: Readline Bare Essentials300726
|
||||
Node: Readline Movement Commands302509
|
||||
Node: Readline Killing Commands303469
|
||||
Node: Readline Arguments305387
|
||||
Node: Searching306431
|
||||
Node: Readline Init File308617
|
||||
Node: Readline Init File Syntax309764
|
||||
Node: Conditional Init Constructs329951
|
||||
Node: Sample Init File332476
|
||||
Node: Bindable Readline Commands335593
|
||||
Node: Commands For Moving336797
|
||||
Node: Commands For History338646
|
||||
Node: Commands For Text342941
|
||||
Node: Commands For Killing346330
|
||||
Node: Numeric Arguments348811
|
||||
Node: Commands For Completion349950
|
||||
Node: Keyboard Macros354141
|
||||
Node: Miscellaneous Commands354828
|
||||
Node: Readline vi Mode360781
|
||||
Node: Programmable Completion361688
|
||||
Node: Programmable Completion Builtins369149
|
||||
Node: A Programmable Completion Example379035
|
||||
Node: Using History Interactively384286
|
||||
Node: Bash History Facilities384970
|
||||
Node: Bash History Builtins387971
|
||||
Node: History Interaction392263
|
||||
Node: Event Designators395227
|
||||
Node: Word Designators396446
|
||||
Node: Modifiers398083
|
||||
Node: Installing Bash399485
|
||||
Node: Basic Installation400622
|
||||
Node: Compilers and Options403313
|
||||
Node: Compiling For Multiple Architectures404054
|
||||
Node: Installation Names405717
|
||||
Node: Specifying the System Type406535
|
||||
Node: Sharing Defaults407251
|
||||
Node: Operation Controls407924
|
||||
Node: Optional Features408882
|
||||
Node: Reporting Bugs419408
|
||||
Node: Major Differences From The Bourne Shell420602
|
||||
Node: GNU Free Documentation License437454
|
||||
Node: Indexes462631
|
||||
Node: Builtin Index463085
|
||||
Node: Reserved Word Index469912
|
||||
Node: Variable Index472360
|
||||
Node: Function Index488038
|
||||
Node: Concept Index501341
|
||||
|
||||
End Tag Table
|
||||
|
||||
+10
-10
@@ -1,4 +1,4 @@
|
||||
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016/MacPorts 2016_5) (preloaded format=pdfetex 2017.1.6) 26 JUN 2017 09:16
|
||||
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/MacPorts 2017_0) (preloaded format=pdfetex 2017.7.5) 23 AUG 2017 16:02
|
||||
entering extended mode
|
||||
restricted \write18 enabled.
|
||||
file:line:error style messages enabled.
|
||||
@@ -243,7 +243,7 @@ arallel -k traceroute[]
|
||||
|
||||
[43] [44]
|
||||
[45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55]
|
||||
Overfull \hbox (26.76846pt too wide) in paragraph at lines 4349--4349
|
||||
Overfull \hbox (26.76846pt too wide) in paragraph at lines 4350--4350
|
||||
[]@texttt mapfile [-d @textttsl de-lim@texttt ] [-n @textttsl count@texttt ] [
|
||||
-O @textttsl ori-gin@texttt ] [-s @textttsl count@texttt ] [-t] [-u @textttsl f
|
||||
d@texttt ][]
|
||||
@@ -257,7 +257,7 @@ d@texttt ][]
|
||||
.etc.
|
||||
|
||||
[56] [57]
|
||||
Overfull \hbox (38.26584pt too wide) in paragraph at lines 4557--4557
|
||||
Overfull \hbox (38.26584pt too wide) in paragraph at lines 4558--4558
|
||||
[]@texttt readarray [-d @textttsl de-lim@texttt ] [-n @textttsl count@texttt ]
|
||||
[-O @textttsl ori-gin@texttt ] [-s @textttsl count@texttt ] [-t] [-u @textttsl
|
||||
fd@texttt ][]
|
||||
@@ -272,7 +272,7 @@ Overfull \hbox (38.26584pt too wide) in paragraph at lines 4557--4557
|
||||
|
||||
[58] [59] [60] [61] [62] [63] [64] [65] [66] [67] [68] [69] [70] Chapter 5
|
||||
[71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] Chapter 6 [83]
|
||||
Overfull \hbox (49.43388pt too wide) in paragraph at lines 6311--6311
|
||||
Overfull \hbox (49.43388pt too wide) in paragraph at lines 6312--6312
|
||||
[]@texttt bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@t
|
||||
exttt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
|
||||
|
||||
@@ -285,7 +285,7 @@ exttt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
|
||||
.etc.
|
||||
|
||||
|
||||
Overfull \hbox (72.42863pt too wide) in paragraph at lines 6312--6312
|
||||
Overfull \hbox (72.42863pt too wide) in paragraph at lines 6313--6313
|
||||
[]@texttt bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@texttt
|
||||
] [-O @textttsl shopt_option@texttt ] -c @textttsl string @texttt [@textttsl ar
|
||||
-
|
||||
@@ -299,7 +299,7 @@ Overfull \hbox (72.42863pt too wide) in paragraph at lines 6312--6312
|
||||
.etc.
|
||||
|
||||
|
||||
Overfull \hbox (32.18782pt too wide) in paragraph at lines 6313--6313
|
||||
Overfull \hbox (32.18782pt too wide) in paragraph at lines 6314--6314
|
||||
[]@texttt bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@text
|
||||
tt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
|
||||
|
||||
@@ -362,7 +362,7 @@ gnored[]
|
||||
|
||||
[121] [122] [123] [124] [125] [126] [127] [128] [129] [130]
|
||||
[131] [132] [133] [134] [135] [136]
|
||||
Overfull \hbox (26.43913pt too wide) in paragraph at lines 2247--2247
|
||||
Overfull \hbox (26.43913pt too wide) in paragraph at lines 2248--2248
|
||||
[] @texttt # Tilde expansion, with side effect of expanding tilde to full p
|
||||
athname[]
|
||||
|
||||
@@ -387,8 +387,8 @@ texinfo.tex: doing @include of fdl.texi
|
||||
[161] [162] [163] [164] [165] [166]) Appendix D [167] [168] [169] [170]
|
||||
[171] [172] [173] [174] [175] [176] )
|
||||
Here is how much of TeX's memory you used:
|
||||
4064 strings out of 497105
|
||||
47069 string characters out of 6206776
|
||||
4064 strings out of 497104
|
||||
47069 string characters out of 6206767
|
||||
136551 words of memory out of 5000000
|
||||
4846 multiletter control sequences out of 15000+600000
|
||||
34315 words of font info for 116 fonts, out of 8000000 for 9000
|
||||
@@ -411,7 +411,7 @@ e/fonts/type1/public/amsfonts/cm/cmtt12.pfb></opt/local/share/texmf-texlive/fon
|
||||
ts/type1/public/amsfonts/cm/cmtt9.pfb></opt/local/share/texmf-texlive/fonts/typ
|
||||
e1/public/cm-super/sfrm1095.pfb></opt/local/share/texmf-texlive/fonts/type1/pub
|
||||
lic/cm-super/sfrm1440.pfb>
|
||||
Output written on bashref.pdf (182 pages, 743436 bytes).
|
||||
Output written on bashref.pdf (182 pages, 743593 bytes).
|
||||
PDF statistics:
|
||||
2608 PDF objects out of 2984 (max. 8388607)
|
||||
2381 compressed objects within 24 object streams
|
||||
|
||||
Binary file not shown.
+121
-115
@@ -1,7 +1,7 @@
|
||||
%!PS-Adobe-2.0
|
||||
%%Creator: dvips(k) 5.996 Copyright 2016 Radical Eye Software
|
||||
%%Creator: dvips(k) 5.997 Copyright 2017 Radical Eye Software
|
||||
%%Title: bashref.dvi
|
||||
%%CreationDate: Mon Jun 26 09:16:48 2017
|
||||
%%CreationDate: Wed Aug 23 20:02:50 2017
|
||||
%%Pages: 182
|
||||
%%PageOrder: Ascend
|
||||
%%BoundingBox: 0 0 612 792
|
||||
@@ -12,7 +12,7 @@
|
||||
%DVIPSWebPage: (www.radicaleye.com)
|
||||
%DVIPSCommandLine: dvips -D 600 -t letter -o bashref.ps bashref.dvi
|
||||
%DVIPSParameters: dpi=600
|
||||
%DVIPSSource: TeX output 2017.06.26:0916
|
||||
%DVIPSSource: TeX output 2017.08.23:1602
|
||||
%%BeginProcSet: tex.pro 0 0
|
||||
%!
|
||||
/TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S
|
||||
@@ -11212,30 +11212,31 @@ b(Builtin)150 828 y(commands)f(are)h(necessary)g(to)g(implemen)m(t)g
|
||||
1868 y(Man)m(y)f(of)f(the)h(builtins)e(ha)m(v)m(e)j(b)s(een)e(extended)
|
||||
g(b)m(y)g Fm(posix)g Fu(or)g(Bash.)275 1996 y(Unless)20
|
||||
b(otherwise)h(noted,)h(eac)m(h)g(builtin)e(command)g(do)s(cumen)m(ted)g
|
||||
(as)h(accepting)h(options)e(preceded)150 2105 y(b)m(y)29
|
||||
b(`)p Ft(-)p Fu(')g(accepts)i(`)p Ft(--)p Fu(')e(to)h(signify)f(the)g
|
||||
(end)g(of)g(the)h(options.)40 b(The)29 b Ft(:)p Fu(,)g
|
||||
Ft(true)p Fu(,)g Ft(false)p Fu(,)f(and)h Ft(test)f Fu(builtins)150
|
||||
2215 y(do)34 b(not)h(accept)h(options)f(and)f(do)g(not)h(treat)h(`)p
|
||||
Ft(--)p Fu(')e(sp)s(ecially)-8 b(.)54 b(The)34 b Ft(exit)p
|
||||
Fu(,)h Ft(logout)p Fu(,)f Ft(return)p Fu(,)g Ft(break)p
|
||||
Fu(,)150 2325 y Ft(continue)p Fu(,)22 b Ft(let)p Fu(,)i(and)e
|
||||
Ft(shift)f Fu(builtins)h(accept)i(and)e(pro)s(cess)g(argumen)m(ts)h(b)s
|
||||
(eginning)f(with)g(`)p Ft(-)p Fu(')h(without)150 2434
|
||||
y(requiring)41 b(`)p Ft(--)p Fu('.)74 b(Other)41 b(builtins)g(that)h
|
||||
(accept)h(argumen)m(ts)e(but)g(are)h(not)g(sp)s(eci\014ed)f(as)g
|
||||
(accepting)150 2544 y(options)25 b(in)m(terpret)f(argumen)m(ts)h(b)s
|
||||
(eginning)e(with)h(`)p Ft(-)p Fu(')h(as)f(in)m(v)-5 b(alid)25
|
||||
b(options)g(and)e(require)h(`)p Ft(--)p Fu(')g(to)h(prev)m(en)m(t)150
|
||||
2653 y(this)30 b(in)m(terpretation.)150 2880 y Fs(4.1)68
|
||||
b(Bourne)45 b(Shell)g(Builtins)150 3040 y Fu(The)22 b(follo)m(wing)j
|
||||
(shell)d(builtin)h(commands)f(are)h(inherited)g(from)f(the)h(Bourne)g
|
||||
(Shell.)38 b(These)22 b(commands)150 3149 y(are)31 b(implemen)m(ted)g
|
||||
(as)f(sp)s(eci\014ed)g(b)m(y)g(the)h Fm(posix)e Fu(standard.)150
|
||||
3295 y Ft(:)h Fu(\(a)h(colon\))870 3405 y Ft(:)47 b([)p
|
||||
Fj(arguments)p Ft(])630 3532 y Fu(Do)c(nothing)f(b)s(ey)m(ond)g
|
||||
(expanding)f Fr(argumen)m(ts)46 b Fu(and)c(p)s(erforming)f
|
||||
(redirections.)76 b(The)630 3642 y(return)29 b(status)i(is)f(zero.)150
|
||||
(as)h(accepting)h(options)e(preceded)150 2105 y(b)m(y)42
|
||||
b(`)p Ft(-)p Fu(')g(accepts)h(`)p Ft(--)p Fu(')f(to)h(signify)f(the)g
|
||||
(end)f(of)h(the)g(options.)76 b(The)41 b Ft(:)p Fu(,)k
|
||||
Ft(true)p Fu(,)f Ft(false)p Fu(,)g(and)d Ft(test)p Fu(/)p
|
||||
Ft([)150 2215 y Fu(builtins)32 b(do)g(not)h(accept)h(options)f(and)f
|
||||
(do)g(not)h(treat)g(`)p Ft(--)p Fu(')g(sp)s(ecially)-8
|
||||
b(.)48 b(The)32 b Ft(exit)p Fu(,)g Ft(logout)p Fu(,)f
|
||||
Ft(return)p Fu(,)150 2325 y Ft(break)p Fu(,)38 b Ft(continue)p
|
||||
Fu(,)f Ft(let)p Fu(,)i(and)d Ft(shift)g Fu(builtins)h(accept)i(and)e
|
||||
(pro)s(cess)g(argumen)m(ts)h(b)s(eginning)e(with)150
|
||||
2434 y(`)p Ft(-)p Fu(')h(without)f(requiring)g(`)p Ft(--)p
|
||||
Fu('.)59 b(Other)36 b(builtins)g(that)h(accept)h(argumen)m(ts)f(but)f
|
||||
(are)h(not)g(sp)s(eci\014ed)f(as)150 2544 y(accepting)28
|
||||
b(options)f(in)m(terpret)g(argumen)m(ts)g(b)s(eginning)e(with)i(`)p
|
||||
Ft(-)p Fu(')f(as)h(in)m(v)-5 b(alid)27 b(options)g(and)f(require)g(`)p
|
||||
Ft(--)p Fu(')150 2653 y(to)31 b(prev)m(en)m(t)g(this)f(in)m
|
||||
(terpretation.)150 2880 y Fs(4.1)68 b(Bourne)45 b(Shell)g(Builtins)150
|
||||
3040 y Fu(The)22 b(follo)m(wing)j(shell)d(builtin)h(commands)f(are)h
|
||||
(inherited)g(from)f(the)h(Bourne)g(Shell.)38 b(These)22
|
||||
b(commands)150 3149 y(are)31 b(implemen)m(ted)g(as)f(sp)s(eci\014ed)g
|
||||
(b)m(y)g(the)h Fm(posix)e Fu(standard.)150 3295 y Ft(:)h
|
||||
Fu(\(a)h(colon\))870 3405 y Ft(:)47 b([)p Fj(arguments)p
|
||||
Ft(])630 3532 y Fu(Do)c(nothing)f(b)s(ey)m(ond)g(expanding)f
|
||||
Fr(argumen)m(ts)46 b Fu(and)c(p)s(erforming)f(redirections.)76
|
||||
b(The)630 3642 y(return)29 b(status)i(is)f(zero.)150
|
||||
3788 y Ft(.)g Fu(\(a)h(p)s(erio)s(d\))870 3897 y Ft(.)47
|
||||
b Fj(filename)f Ft([)p Fj(arguments)p Ft(])630 4025 y
|
||||
Fu(Read)34 b(and)f(execute)i(commands)e(from)g(the)h
|
||||
@@ -11359,24 +11360,26 @@ Fr(command)p Fu(.)630 1110 y(If)c Fr(command)j Fu(cannot)e(b)s(e)f
|
||||
(executed)h(for)f(some)g(reason,)h(a)g(non-in)m(teractiv)m(e)i(shell)d
|
||||
(exits,)630 1219 y(unless)27 b(the)g Ft(execfail)e Fu(shell)i(option)h
|
||||
(is)f(enabled.)40 b(In)27 b(that)g(case,)j(it)d(returns)f(failure.)40
|
||||
b(An)630 1329 y(in)m(teractiv)m(e)d(shell)c(returns)g(failure)h(if)f
|
||||
(the)h(\014le)g(cannot)g(b)s(e)f(executed.)52 b(If)33
|
||||
b(no)h Fr(command)630 1439 y Fu(is)27 b(sp)s(eci\014ed,)g(redirections)
|
||||
h(ma)m(y)f(b)s(e)g(used)f(to)i(a\013ect)g(the)f(curren)m(t)g(shell)g
|
||||
(en)m(vironmen)m(t.)40 b(If)630 1548 y(there)34 b(are)h(no)f
|
||||
(redirection)h(errors,)g(the)f(return)f(status)i(is)f(zero;)j
|
||||
(otherwise)e(the)f(return)630 1658 y(status)d(is)f(non-zero.)150
|
||||
1811 y Ft(exit)870 1943 y(exit)47 b([)p Fj(n)p Ft(])630
|
||||
2074 y Fu(Exit)30 b(the)g(shell,)h(returning)d(a)j(status)f(of)g
|
||||
Fr(n)f Fu(to)h(the)g(shell's)g(paren)m(t.)41 b(If)30
|
||||
b Fr(n)f Fu(is)h(omitted,)h(the)630 2184 y(exit)c(status)g(is)g(that)g
|
||||
(of)g(the)g(last)g(command)f(executed.)41 b(An)m(y)26
|
||||
b(trap)h(on)f Ft(EXIT)f Fu(is)i(executed)630 2293 y(b)s(efore)j(the)h
|
||||
(shell)f(terminates.)150 2447 y Ft(export)870 2578 y(export)46
|
||||
b([-fn])g([-p])h([)p Fj(name)p Ft([=)p Fj(value)p Ft(]])630
|
||||
2710 y Fu(Mark)40 b(eac)m(h)h Fr(name)k Fu(to)40 b(b)s(e)f(passed)g(to)
|
||||
i(c)m(hild)f(pro)s(cesses)f(in)g(the)h(en)m(vironmen)m(t.)70
|
||||
b(If)39 b(the)630 2819 y Ft(-f)33 b Fu(option)h(is)g(supplied,)f(the)h
|
||||
b(An)630 1329 y(in)m(teractiv)m(e)35 b(shell)d(returns)f(failure)h(if)g
|
||||
(the)g(\014le)g(cannot)h(b)s(e)e(executed.)47 b(A)32
|
||||
b(subshell)f(exits)630 1439 y(unconditionally)j(if)g
|
||||
Ft(exec)f Fu(fails.)52 b(If)33 b(no)h Fr(command)j Fu(is)d(sp)s
|
||||
(eci\014ed,)h(redirections)f(ma)m(y)h(b)s(e)630 1548
|
||||
y(used)30 b(to)i(a\013ect)g(the)f(curren)m(t)g(shell)g(en)m(vironmen)m
|
||||
(t.)43 b(If)30 b(there)i(are)f(no)g(redirection)g(errors,)630
|
||||
1658 y(the)g(return)e(status)i(is)f(zero;)h(otherwise)g(the)g(return)e
|
||||
(status)i(is)f(non-zero.)150 1811 y Ft(exit)870 1943
|
||||
y(exit)47 b([)p Fj(n)p Ft(])630 2074 y Fu(Exit)30 b(the)g(shell,)h
|
||||
(returning)d(a)j(status)f(of)g Fr(n)f Fu(to)h(the)g(shell's)g(paren)m
|
||||
(t.)41 b(If)30 b Fr(n)f Fu(is)h(omitted,)h(the)630 2184
|
||||
y(exit)c(status)g(is)g(that)g(of)g(the)g(last)g(command)f(executed.)41
|
||||
b(An)m(y)26 b(trap)h(on)f Ft(EXIT)f Fu(is)i(executed)630
|
||||
2293 y(b)s(efore)j(the)h(shell)f(terminates.)150 2447
|
||||
y Ft(export)870 2578 y(export)46 b([-fn])g([-p])h([)p
|
||||
Fj(name)p Ft([=)p Fj(value)p Ft(]])630 2710 y Fu(Mark)40
|
||||
b(eac)m(h)h Fr(name)k Fu(to)40 b(b)s(e)f(passed)g(to)i(c)m(hild)f(pro)s
|
||||
(cesses)f(in)g(the)h(en)m(vironmen)m(t.)70 b(If)39 b(the)630
|
||||
2819 y Ft(-f)33 b Fu(option)h(is)g(supplied,)f(the)h
|
||||
Fr(name)5 b Fu(s)33 b(refer)g(to)i(shell)e(functions;)i(otherwise)f
|
||||
(the)g(names)630 2929 y(refer)c(to)h(shell)g(v)-5 b(ariables.)41
|
||||
b(The)30 b Ft(-n)f Fu(option)i(means)f(to)h(no)f(longer)h(mark)f(eac)m
|
||||
@@ -14165,72 +14168,73 @@ TeXDict begin 85 90 bop 150 -116 a Fu(Chapter)30 b(6:)41
|
||||
b(Bash)30 b(F)-8 b(eatures)2484 b(85)150 299 y Ft(--restricted)630
|
||||
408 y Fu(Mak)m(e)54 b(the)e(shell)g(a)h(restricted)g(shell)f(\(see)h
|
||||
(Section)g(6.10)h([The)d(Restricted)j(Shell],)630 518
|
||||
y(page)31 b(97\).)150 687 y Ft(--verbose)630 796 y Fu(Equiv)-5
|
||||
y(page)31 b(97\).)150 677 y Ft(--verbose)630 787 y Fu(Equiv)-5
|
||||
b(alen)m(t)31 b(to)g Ft(-v)p Fu(.)41 b(Prin)m(t)30 b(shell)g(input)g
|
||||
(lines)g(as)h(they're)g(read.)150 965 y Ft(--version)630
|
||||
1074 y Fu(Sho)m(w)d(v)m(ersion)g(information)g(for)g(this)g(instance)h
|
||||
(of)f(Bash)g(on)g(the)g(standard)f(output)h(and)630 1184
|
||||
y(exit)j(successfully)-8 b(.)275 1357 y(There)28 b(are)i(sev)m(eral)g
|
||||
(lines)g(as)h(they're)g(read.)150 946 y Ft(--version)630
|
||||
1056 y Fu(Sho)m(w)d(v)m(ersion)g(information)g(for)g(this)g(instance)h
|
||||
(of)f(Bash)g(on)g(the)g(standard)f(output)h(and)630 1166
|
||||
y(exit)j(successfully)-8 b(.)275 1325 y(There)28 b(are)i(sev)m(eral)g
|
||||
(single-c)m(haracter)i(options)d(that)h(ma)m(y)g(b)s(e)e(supplied)g(at)
|
||||
i(in)m(v)m(o)s(cation)h(whic)m(h)e(are)150 1467 y(not)i(a)m(v)-5
|
||||
i(in)m(v)m(o)s(cation)h(whic)m(h)e(are)150 1435 y(not)i(a)m(v)-5
|
||||
b(ailable)32 b(with)e(the)h Ft(set)e Fu(builtin.)150
|
||||
1640 y Ft(-c)384 b Fu(Read)66 b(and)f(execute)i(commands)e(from)g(the)h
|
||||
(\014rst)e(non-option)i(argumen)m(t)g Fr(com-)630 1749
|
||||
y(mand)p 859 1749 28 4 v 39 w(string)p Fu(,)34 b(then)e(exit.)49
|
||||
1594 y Ft(-c)384 b Fu(Read)66 b(and)f(execute)i(commands)e(from)g(the)h
|
||||
(\014rst)e(non-option)i(argumen)m(t)g Fr(com-)630 1704
|
||||
y(mand)p 859 1704 28 4 v 39 w(string)p Fu(,)34 b(then)e(exit.)49
|
||||
b(If)32 b(there)h(are)g(argumen)m(ts)g(after)g(the)g
|
||||
Fr(command)p 3303 1749 V 40 w(string)p Fu(,)h(the)630
|
||||
1859 y(\014rst)e(argumen)m(t)h(is)g(assigned)g(to)h Ft($0)e
|
||||
Fr(command)p 3303 1704 V 40 w(string)p Fu(,)h(the)630
|
||||
1813 y(\014rst)e(argumen)m(t)h(is)g(assigned)g(to)h Ft($0)e
|
||||
Fu(and)h(an)m(y)g(remaining)g(argumen)m(ts)g(are)g(assigned)g(to)630
|
||||
1968 y(the)38 b(p)s(ositional)h(parameters.)65 b(The)37
|
||||
1923 y(the)38 b(p)s(ositional)h(parameters.)65 b(The)37
|
||||
b(assignmen)m(t)i(to)g Ft($0)f Fu(sets)g(the)h(name)f(of)g(the)g
|
||||
(shell,)630 2078 y(whic)m(h)30 b(is)h(used)e(in)h(w)m(arning)g(and)g
|
||||
(error)g(messages.)150 2247 y Ft(-i)384 b Fu(F)-8 b(orce)22
|
||||
(shell,)630 2032 y(whic)m(h)30 b(is)h(used)e(in)h(w)m(arning)g(and)g
|
||||
(error)g(messages.)150 2192 y Ft(-i)384 b Fu(F)-8 b(orce)22
|
||||
b(the)g(shell)f(to)g(run)f(in)m(teractiv)m(ely)-8 b(.)41
|
||||
b(In)m(teractiv)m(e)23 b(shells)e(are)h(describ)s(ed)d(in)i(Section)h
|
||||
(6.3)630 2356 y([In)m(teractiv)m(e)33 b(Shells],)e(page)g(87.)150
|
||||
2525 y Ft(-l)384 b Fu(Mak)m(e)33 b(this)e(shell)h(act)g(as)g(if)f(it)h
|
||||
(6.3)630 2301 y([In)m(teractiv)m(e)33 b(Shells],)e(page)g(87.)150
|
||||
2461 y Ft(-l)384 b Fu(Mak)m(e)33 b(this)e(shell)h(act)g(as)g(if)f(it)h
|
||||
(had)f(b)s(een)f(directly)i(in)m(v)m(ok)m(ed)h(b)m(y)f(login.)44
|
||||
b(When)31 b(the)h(shell)630 2634 y(is)37 b(in)m(teractiv)m(e,)43
|
||||
b(When)31 b(the)h(shell)630 2570 y(is)37 b(in)m(teractiv)m(e,)43
|
||||
b(this)37 b(is)g(equiv)-5 b(alen)m(t)39 b(to)f(starting)h(a)e(login)i
|
||||
(shell)e(with)g(`)p Ft(exec)30 b(-l)g(bash)p Fu('.)630
|
||||
2744 y(When)h(the)g(shell)h(is)f(not)g(in)m(teractiv)m(e,)k(the)c
|
||||
2680 y(When)h(the)g(shell)h(is)f(not)g(in)m(teractiv)m(e,)k(the)c
|
||||
(login)h(shell)g(startup)f(\014les)g(will)g(b)s(e)g(executed.)630
|
||||
2853 y(`)p Ft(exec)e(bash)h(-l)p Fu(')43 b(or)h(`)p Ft(exec)29
|
||||
2790 y(`)p Ft(exec)e(bash)h(-l)p Fu(')43 b(or)h(`)p Ft(exec)29
|
||||
b(bash)g(--login)p Fu(')42 b(will)i(replace)h(the)f(curren)m(t)f(shell)
|
||||
h(with)g(a)630 2963 y(Bash)26 b(login)g(shell.)39 b(See)26
|
||||
h(with)g(a)630 2899 y(Bash)26 b(login)g(shell.)39 b(See)26
|
||||
b(Section)g(6.2)h([Bash)e(Startup)g(Files],)j(page)e(86,)i(for)d(a)h
|
||||
(description)630 3073 y(of)31 b(the)f(sp)s(ecial)h(b)s(eha)m(vior)g(of)
|
||||
f(a)h(login)g(shell.)150 3241 y Ft(-r)384 b Fu(Mak)m(e)54
|
||||
(description)630 3009 y(of)31 b(the)f(sp)s(ecial)h(b)s(eha)m(vior)g(of)
|
||||
f(a)h(login)g(shell.)150 3168 y Ft(-r)384 b Fu(Mak)m(e)54
|
||||
b(the)e(shell)g(a)h(restricted)g(shell)f(\(see)h(Section)g(6.10)h([The)
|
||||
d(Restricted)j(Shell],)630 3351 y(page)31 b(97\).)150
|
||||
3519 y Ft(-s)384 b Fu(If)24 b(this)h(option)h(is)f(presen)m(t,)h(or)f
|
||||
d(Restricted)j(Shell],)630 3278 y(page)31 b(97\).)150
|
||||
3437 y Ft(-s)384 b Fu(If)24 b(this)h(option)h(is)f(presen)m(t,)h(or)f
|
||||
(if)g(no)f(argumen)m(ts)i(remain)e(after)i(option)f(pro)s(cessing,)h
|
||||
(then)630 3629 y(commands)i(are)h(read)g(from)f(the)h(standard)f
|
||||
(then)630 3547 y(commands)i(are)h(read)g(from)f(the)h(standard)f
|
||||
(input.)39 b(This)28 b(option)h(allo)m(ws)h(the)f(p)s(ositional)630
|
||||
3738 y(parameters)i(to)g(b)s(e)f(set)g(when)g(in)m(v)m(oking)h(an)g(in)
|
||||
m(teractiv)m(e)i(shell.)150 3907 y Ft(-D)384 b Fu(A)37
|
||||
b(list)g(of)f(all)i(double-quoted)e(strings)g(preceded)g(b)m(y)h(`)p
|
||||
Ft($)p Fu(')f(is)h(prin)m(ted)f(on)g(the)h(standard)630
|
||||
4017 y(output.)63 b(These)38 b(are)g(the)g(strings)g(that)h(are)f(sub)5
|
||||
b(ject)38 b(to)h(language)g(translation)g(when)630 4126
|
||||
3656 y(parameters)i(to)h(b)s(e)e(set)i(when)d(in)m(v)m(oking)k(an)d(in)
|
||||
m(teractiv)m(e)k(shell)d(or)g(when)f(reading)h(input)630
|
||||
3766 y(through)f(a)g(pip)s(e.)150 3925 y Ft(-D)384 b
|
||||
Fu(A)37 b(list)g(of)f(all)i(double-quoted)e(strings)g(preceded)g(b)m(y)
|
||||
h(`)p Ft($)p Fu(')f(is)h(prin)m(ted)f(on)g(the)h(standard)630
|
||||
4035 y(output.)63 b(These)38 b(are)g(the)g(strings)g(that)h(are)f(sub)5
|
||||
b(ject)38 b(to)h(language)g(translation)g(when)630 4144
|
||||
y(the)e(curren)m(t)g(lo)s(cale)h(is)f(not)g Ft(C)g Fu(or)f
|
||||
Ft(POSIX)g Fu(\(see)h(Section)h(3.1.2.5)h([Lo)s(cale)g(T)-8
|
||||
b(ranslation],)630 4236 y(page)31 b(7\).)42 b(This)29
|
||||
b(ranslation],)630 4254 y(page)31 b(7\).)42 b(This)29
|
||||
b(implies)i(the)f Ft(-n)g Fu(option;)h(no)f(commands)g(will)h(b)s(e)f
|
||||
(executed.)150 4404 y Ft([-+]O)f([)p Fj(shopt_option)p
|
||||
Ft(])630 4514 y Fr(shopt)p 854 4514 V 40 w(option)44
|
||||
(executed.)150 4413 y Ft([-+]O)f([)p Fj(shopt_option)p
|
||||
Ft(])630 4523 y Fr(shopt)p 854 4523 V 40 w(option)44
|
||||
b Fu(is)g(one)h(of)f(the)g(shell)h(options)f(accepted)h(b)m(y)f(the)h
|
||||
Ft(shopt)d Fu(builtin)i(\(see)630 4623 y(Section)32 b(4.3.2)h([The)e
|
||||
Ft(shopt)d Fu(builtin)i(\(see)630 4633 y(Section)32 b(4.3.2)h([The)e
|
||||
(Shopt)f(Builtin],)i(page)g(65\).)44 b(If)31 b Fr(shopt)p
|
||||
2724 4623 V 40 w(option)g Fu(is)g(presen)m(t,)h Ft(-O)f
|
||||
Fu(sets)630 4733 y(the)24 b(v)-5 b(alue)24 b(of)g(that)h(option;)h
|
||||
2724 4633 V 40 w(option)g Fu(is)g(presen)m(t,)h Ft(-O)f
|
||||
Fu(sets)630 4742 y(the)24 b(v)-5 b(alue)24 b(of)g(that)h(option;)h
|
||||
Ft(+O)e Fu(unsets)f(it.)39 b(If)23 b Fr(shopt)p 2423
|
||||
4733 V 40 w(option)h Fu(is)g(not)g(supplied,)g(the)g(names)630
|
||||
4843 y(and)31 b(v)-5 b(alues)32 b(of)g(the)g(shell)g(options)g
|
||||
4742 V 40 w(option)h Fu(is)g(not)g(supplied,)g(the)g(names)630
|
||||
4852 y(and)31 b(v)-5 b(alues)32 b(of)g(the)g(shell)g(options)g
|
||||
(accepted)h(b)m(y)f Ft(shopt)e Fu(are)i(prin)m(ted)f(on)h(the)g
|
||||
(standard)630 4952 y(output.)40 b(If)29 b(the)h(in)m(v)m(o)s(cation)h
|
||||
(standard)630 4961 y(output.)40 b(If)29 b(the)h(in)m(v)m(o)s(cation)h
|
||||
(option)f(is)f Ft(+O)p Fu(,)h(the)f(output)g(is)h(displa)m(y)m(ed)g(in)
|
||||
f(a)h(format)f(that)630 5062 y(ma)m(y)i(b)s(e)f(reused)f(as)i(input.)
|
||||
f(a)h(format)f(that)630 5071 y(ma)m(y)i(b)s(e)f(reused)f(as)i(input.)
|
||||
150 5230 y Ft(--)384 b Fu(A)38 b Ft(--)g Fu(signals)g(the)h(end)e(of)i
|
||||
(options)f(and)g(disables)g(further)f(option)h(pro)s(cessing.)64
|
||||
b(An)m(y)630 5340 y(argumen)m(ts)31 b(after)g(the)f Ft(--)g
|
||||
@@ -17277,50 +17281,52 @@ b(Command)29 b(Line)i(Editing)2062 b(130)150 299 y Ft
|
||||
(pathname)h(expansion,)g(with)g(an)630 518 y(asterisk)d(implicitly)h
|
||||
(app)s(ended.)37 b(This)23 b(pattern)i(is)f(used)g(to)h(generate)h(a)e
|
||||
(list)h(of)g(matc)m(hing)630 628 y(\014le)30 b(names)h(for)f(p)s
|
||||
(ossible)g(completions.)150 790 y Ft(glob-expand-word)c(\(C-x)j(*\))630
|
||||
900 y Fu(The)40 b(w)m(ord)g(b)s(efore)g(p)s(oin)m(t)h(is)g(treated)g
|
||||
(ossible)g(completions.)150 781 y Ft(glob-expand-word)c(\(C-x)j(*\))630
|
||||
891 y Fu(The)40 b(w)m(ord)g(b)s(efore)g(p)s(oin)m(t)h(is)g(treated)g
|
||||
(as)g(a)g(pattern)g(for)f(pathname)g(expansion,)k(and)630
|
||||
1009 y(the)c(list)g(of)f(matc)m(hing)i(\014le)e(names)g(is)h(inserted,)
|
||||
1000 y(the)c(list)g(of)f(matc)m(hing)i(\014le)e(names)g(is)h(inserted,)
|
||||
h(replacing)g(the)e(w)m(ord.)67 b(If)39 b(a)h(n)m(umeric)630
|
||||
1119 y(argumen)m(t)31 b(is)f(supplied,)g(a)g(`)p Ft(*)p
|
||||
1110 y(argumen)m(t)31 b(is)f(supplied,)g(a)g(`)p Ft(*)p
|
||||
Fu(')h(is)f(app)s(ended)f(b)s(efore)h(pathname)g(expansion.)150
|
||||
1281 y Ft(glob-list-expansions)25 b(\(C-x)k(g\))630 1391
|
||||
1263 y Ft(glob-list-expansions)25 b(\(C-x)k(g\))630 1373
|
||||
y Fu(The)k(list)h(of)f(expansions)g(that)h(w)m(ould)f(ha)m(v)m(e)h(b)s
|
||||
(een)f(generated)h(b)m(y)f Ft(glob-expand-word)630 1501
|
||||
(een)f(generated)h(b)m(y)f Ft(glob-expand-word)630 1482
|
||||
y Fu(is)h(displa)m(y)m(ed,)h(and)e(the)h(line)g(is)f(redra)m(wn.)50
|
||||
b(If)33 b(a)h(n)m(umeric)g(argumen)m(t)g(is)f(supplied,)h(a)g(`)p
|
||||
Ft(*)p Fu(')630 1610 y(is)c(app)s(ended)f(b)s(efore)h(pathname)g
|
||||
(expansion.)150 1773 y Ft(display-shell-version)25 b(\(C-x)k(C-v\))630
|
||||
1882 y Fu(Displa)m(y)j(v)m(ersion)e(information)h(ab)s(out)f(the)h
|
||||
(curren)m(t)f(instance)h(of)f(Bash.)150 2045 y Ft(shell-expand-line)c
|
||||
(\(M-C-e\))630 2154 y Fu(Expand)34 b(the)h(line)h(as)g(the)f(shell)h
|
||||
Ft(*)p Fu(')630 1592 y(is)c(app)s(ended)f(b)s(efore)h(pathname)g
|
||||
(expansion.)150 1746 y Ft(display-shell-version)25 b(\(C-x)k(C-v\))630
|
||||
1855 y Fu(Displa)m(y)j(v)m(ersion)e(information)h(ab)s(out)f(the)h
|
||||
(curren)m(t)f(instance)h(of)f(Bash.)150 2009 y Ft(shell-expand-line)c
|
||||
(\(M-C-e\))630 2118 y Fu(Expand)34 b(the)h(line)h(as)g(the)f(shell)h
|
||||
(do)s(es.)55 b(This)34 b(p)s(erforms)g(alias)i(and)f(history)g
|
||||
(expansion)630 2264 y(as)f(w)m(ell)g(as)g(all)h(of)e(the)h(shell)g(w)m
|
||||
(expansion)630 2228 y(as)f(w)m(ell)g(as)g(all)h(of)e(the)h(shell)g(w)m
|
||||
(ord)f(expansions)g(\(see)i(Section)f(3.5)h([Shell)e(Expansions],)630
|
||||
2373 y(page)e(22\).)150 2536 y Ft(history-expand-line)25
|
||||
b(\(M-^\))630 2645 y Fu(P)m(erform)30 b(history)h(expansion)f(on)g(the)
|
||||
h(curren)m(t)f(line.)150 2808 y Ft(magic-space)d(\(\))630
|
||||
2917 y Fu(P)m(erform)c(history)g(expansion)g(on)g(the)g(curren)m(t)g
|
||||
2337 y(page)e(22\).)150 2491 y Ft(history-expand-line)25
|
||||
b(\(M-^\))630 2600 y Fu(P)m(erform)30 b(history)h(expansion)f(on)g(the)
|
||||
h(curren)m(t)f(line.)150 2754 y Ft(magic-space)d(\(\))630
|
||||
2863 y Fu(P)m(erform)c(history)g(expansion)g(on)g(the)g(curren)m(t)g
|
||||
(line)g(and)g(insert)g(a)g(space)h(\(see)g(Section)g(9.3)630
|
||||
3027 y([History)31 b(In)m(teraction],)i(page)e(142\).)150
|
||||
3190 y Ft(alias-expand-line)26 b(\(\))630 3299 y Fu(P)m(erform)i(alias)
|
||||
2973 y([History)31 b(In)m(teraction],)i(page)e(142\).)150
|
||||
3126 y Ft(alias-expand-line)26 b(\(\))630 3236 y Fu(P)m(erform)i(alias)
|
||||
i(expansion)e(on)g(the)h(curren)m(t)f(line)h(\(see)g(Section)g(6.6)h
|
||||
([Aliases],)g(page)f(92\).)150 3462 y Ft(history-and-alias-expand)o
|
||||
(-lin)o(e)24 b(\(\))630 3571 y Fu(P)m(erform)30 b(history)h(and)e
|
||||
([Aliases],)g(page)f(92\).)150 3390 y Ft(history-and-alias-expand)o
|
||||
(-lin)o(e)24 b(\(\))630 3499 y Fu(P)m(erform)30 b(history)h(and)e
|
||||
(alias)j(expansion)e(on)g(the)h(curren)m(t)f(line.)150
|
||||
3734 y Ft(insert-last-argument)25 b(\(M-.)k(or)h(M-_\))630
|
||||
3843 y Fu(A)g(synon)m(ym)g(for)g Ft(yank-last-arg)p Fu(.)150
|
||||
4006 y Ft(operate-and-get-next)25 b(\(C-o\))630 4115
|
||||
3653 y Ft(insert-last-argument)25 b(\(M-.)k(or)h(M-_\))630
|
||||
3762 y Fu(A)g(synon)m(ym)g(for)g Ft(yank-last-arg)p Fu(.)150
|
||||
3916 y Ft(operate-and-get-next)25 b(\(C-o\))630 4025
|
||||
y Fu(Accept)42 b(the)e(curren)m(t)h(line)f(for)h(execution)g(and)f
|
||||
(fetc)m(h)i(the)e(next)h(line)g(relativ)m(e)i(to)e(the)630
|
||||
4225 y(curren)m(t)30 b(line)h(from)f(the)g(history)h(for)f(editing.)41
|
||||
b(An)m(y)31 b(argumen)m(t)f(is)h(ignored.)150 4387 y
|
||||
Ft(edit-and-execute-command)24 b(\(C-x)29 b(C-e\))630
|
||||
4497 y Fu(In)m(v)m(ok)m(e)34 b(an)f(editor)g(on)g(the)g(curren)m(t)f
|
||||
4135 y(curren)m(t)h(line)h(from)g(the)f(history)h(for)f(editing.)79
|
||||
b(A)42 b(n)m(umeric)h(argumen)m(t,)j(if)d(supplied,)630
|
||||
4244 y(sp)s(eci\014es)30 b(the)h(history)f(en)m(try)h(to)g(use)f
|
||||
(instead)g(of)h(the)f(curren)m(t)h(line.)150 4398 y Ft
|
||||
(edit-and-execute-command)24 b(\(C-x)29 b(C-e\))630 4507
|
||||
y Fu(In)m(v)m(ok)m(e)34 b(an)f(editor)g(on)g(the)g(curren)m(t)f
|
||||
(command)h(line,)h(and)e(execute)i(the)f(result)g(as)g(shell)630
|
||||
4606 y(commands.)81 b(Bash)44 b(attempts)h(to)g(in)m(v)m(ok)m(e)h
|
||||
4617 y(commands.)81 b(Bash)44 b(attempts)h(to)g(in)m(v)m(ok)m(e)h
|
||||
Ft($VISUAL)p Fu(,)f Ft($EDITOR)p Fu(,)h(and)d Ft(emacs)g
|
||||
Fu(as)h(the)630 4716 y(editor,)31 b(in)f(that)h(order.)150
|
||||
Fu(as)h(the)630 4727 y(editor,)31 b(in)f(that)h(order.)150
|
||||
4961 y Fs(8.5)68 b(Readline)47 b(vi)e(Mo)t(de)150 5121
|
||||
y Fu(While)32 b(the)g(Readline)g(library)f(do)s(es)g(not)h(ha)m(v)m(e)h
|
||||
(a)f(full)f(set)h(of)g Ft(vi)f Fu(editing)h(functions,)f(it)h(do)s(es)g
|
||||
|
||||
@@ -3498,6 +3498,7 @@ cannot be executed for some reason, a non-interactive shell exits,
|
||||
unless the @code{execfail} shell option
|
||||
is enabled. In that case, it returns failure.
|
||||
An interactive shell returns failure if the file cannot be executed.
|
||||
A subshell exits unconditionally if @code{exec} fails.
|
||||
If no @var{command} is specified, redirections may be used to affect
|
||||
the current shell environment. If there are no redirection errors, the
|
||||
return status is zero; otherwise the return status is non-zero.
|
||||
|
||||
+607
-606
File diff suppressed because it is too large
Load Diff
+48
-45
@@ -1,6 +1,6 @@
|
||||
%!PS-Adobe-3.0
|
||||
%%Creator: groff version 1.22.3
|
||||
%%CreationDate: Mon Jun 26 09:16:26 2017
|
||||
%%CreationDate: Wed Aug 23 16:02:43 2017
|
||||
%%DocumentNeededResources: font Times-Roman
|
||||
%%+ font Times-Bold
|
||||
%%+ font Times-Italic
|
||||
@@ -257,43 +257,44 @@ imes, trap, true, type, typeset, ulimit, umask, unalias, unset, w)108
|
||||
.329 E(UIL)-.11 E(TIN COMMANDS)-1.007 E F0 .063
|
||||
(Unless otherwise noted, each b)108 172.8 R .062(uiltin command documen\
|
||||
ted in this section as accepting options preceded by)-.2 F F2<ad>108
|
||||
184.8 Q F0(accepts)2.533 E F2<adad>2.533 E F0 .034
|
||||
(to signify the end of the options.)2.533 F(The)5.034 E F2(:)2.534 E F0
|
||||
(,)A F2(true)2.534 E F0(,)A F2(false)2.534 E F0 2.534(,a)C(nd)-2.534 E
|
||||
F2(test)2.534 E F0 -.2(bu)2.534 G .034(iltins do not accept options and)
|
||||
.2 F 1.549(do not treat)108 196.8 R F2<adad>4.049 E F0(specially)4.049 E
|
||||
6.549(.T)-.65 G(he)-6.549 E F2(exit)4.049 E F0(,)A F2(logout)4.049 E F0
|
||||
(,)A F2 -.18(re)4.049 G(tur).18 E(n)-.15 E F0(,)A F2(br)4.049 E(eak)-.18
|
||||
E F0(,)A F2(continue)4.049 E F0(,)A F2(let)4.049 E F0 4.049(,a)C(nd)
|
||||
-4.049 E F2(shift)4.048 E F0 -.2(bu)4.048 G 1.548(iltins accept and).2 F
|
||||
.26(process ar)108 208.8 R .26(guments be)-.18 F .26(ginning with)-.15 F
|
||||
F2<ad>2.76 E F0 .261(without requiring)2.76 F F2<adad>2.761 E F0 5.261
|
||||
(.O)C .261(ther b)-5.261 F .261(uiltins that accept ar)-.2 F .261
|
||||
(guments b)-.18 F .261(ut are not)-.2 F 1.154
|
||||
(speci\214ed as accepting options interpret ar)108 220.8 R 1.154
|
||||
(guments be)-.18 F 1.154(ginning with)-.15 F F2<ad>3.654 E F0 1.154
|
||||
(as in)3.654 F -.25(va)-.4 G 1.154(lid options and require).25 F F2
|
||||
<adad>3.654 E F0(to)3.654 E(pre)108 232.8 Q -.15(ve)-.25 G
|
||||
(nt this interpretation.).15 E F2(:)108 250.8 Q F0([)2.5 E/F3 10
|
||||
/Times-Italic@0 SF(ar)A(guments)-.37 E F0(])A .451(No ef)144 262.8 R
|
||||
.451(fect; the command does nothing be)-.25 F .452(yond e)-.15 F
|
||||
(xpanding)-.15 E F3(ar)3.282 E(guments)-.37 E F0 .452(and performing an)
|
||||
3.222 F 2.952(ys)-.15 G(peci\214ed)-2.952 E 2.5(redirections. The)144
|
||||
274.8 R(return status is zero.)2.5 E F2(.)110.5 291.6 Q F3(\214lename)
|
||||
6.666 E F0([)2.5 E F3(ar)A(guments)-.37 E F0(])A F2(sour)108 303.6 Q(ce)
|
||||
-.18 E F3(\214lename)2.5 E F0([)2.5 E F3(ar)A(guments)-.37 E F0(])A 1.02
|
||||
(Read and e)144 315.6 R -.15(xe)-.15 G 1.02(cute commands from).15 F F3
|
||||
(\214lename)5.43 E F0 1.02(in the current shell en)3.7 F 1.02
|
||||
(vironment and return the e)-.4 F(xit)-.15 E 1.458
|
||||
(status of the last command e)144 327.6 R -.15(xe)-.15 G 1.458
|
||||
(cuted from).15 F F3(\214lename)3.958 E F0 6.458(.I).18 G(f)-6.458 E F3
|
||||
(\214lename)5.868 E F0 1.458(does not contain a slash, \214le-)4.138 F
|
||||
.608(names in)144 339.6 R/F4 9/Times-Bold@0 SF -.666(PA)3.108 G(TH)-.189
|
||||
E F0 .608(are used to \214nd the directory containing)2.858 F F3
|
||||
(\214lename)3.108 E F0 5.608(.T).18 G .608(he \214le searched for in)
|
||||
-5.608 F F4 -.666(PA)3.108 G(TH)-.189 E F0 .832(need not be e)144 351.6
|
||||
R -.15(xe)-.15 G 3.332(cutable. When).15 F F2(bash)3.332 E F0 .832
|
||||
(is not in)3.332 F F3 .832(posix mode)3.332 F F0 3.332(,t)C .833
|
||||
184.8 Q F0(accepts)3.077 E F2<adad>3.077 E F0 .577
|
||||
(to signify the end of the options.)3.077 F(The)5.577 E F2(:)3.077 E F0
|
||||
(,)A F2(true)3.077 E F0(,)A F2(false)3.077 E F0 3.077(,a)C(nd)-3.077 E
|
||||
F2(test)3.077 E F0(/)A F2([)A F0 -.2(bu)3.077 G .577
|
||||
(iltins do not accept options).2 F .462(and do not treat)108 196.8 R F2
|
||||
<adad>2.961 E F0(specially)2.961 E 5.461(.T)-.65 G(he)-5.461 E F2(exit)
|
||||
2.961 E F0(,)A F2(logout)2.961 E F0(,)A F2 -.18(re)2.961 G(tur).18 E(n)
|
||||
-.15 E F0(,)A F2(br)2.961 E(eak)-.18 E F0(,)A F2(continue)2.961 E F0(,)A
|
||||
F2(let)2.961 E F0 2.961(,a)C(nd)-2.961 E F2(shift)2.961 E F0 -.2(bu)
|
||||
2.961 G .461(iltins accept and).2 F .26(process ar)108 208.8 R .26
|
||||
(guments be)-.18 F .26(ginning with)-.15 F F2<ad>2.76 E F0 .261
|
||||
(without requiring)2.76 F F2<adad>2.761 E F0 5.261(.O)C .261(ther b)
|
||||
-5.261 F .261(uiltins that accept ar)-.2 F .261(guments b)-.18 F .261
|
||||
(ut are not)-.2 F 1.154(speci\214ed as accepting options interpret ar)
|
||||
108 220.8 R 1.154(guments be)-.18 F 1.154(ginning with)-.15 F F2<ad>
|
||||
3.654 E F0 1.154(as in)3.654 F -.25(va)-.4 G 1.154
|
||||
(lid options and require).25 F F2<adad>3.654 E F0(to)3.654 E(pre)108
|
||||
232.8 Q -.15(ve)-.25 G(nt this interpretation.).15 E F2(:)108 250.8 Q F0
|
||||
([)2.5 E/F3 10/Times-Italic@0 SF(ar)A(guments)-.37 E F0(])A .451(No ef)
|
||||
144 262.8 R .451(fect; the command does nothing be)-.25 F .452(yond e)
|
||||
-.15 F(xpanding)-.15 E F3(ar)3.282 E(guments)-.37 E F0 .452
|
||||
(and performing an)3.222 F 2.952(ys)-.15 G(peci\214ed)-2.952 E 2.5
|
||||
(redirections. The)144 274.8 R(return status is zero.)2.5 E F2(.)110.5
|
||||
291.6 Q F3(\214lename)6.666 E F0([)2.5 E F3(ar)A(guments)-.37 E F0(])A
|
||||
F2(sour)108 303.6 Q(ce)-.18 E F3(\214lename)2.5 E F0([)2.5 E F3(ar)A
|
||||
(guments)-.37 E F0(])A 1.02(Read and e)144 315.6 R -.15(xe)-.15 G 1.02
|
||||
(cute commands from).15 F F3(\214lename)5.43 E F0 1.02
|
||||
(in the current shell en)3.7 F 1.02(vironment and return the e)-.4 F
|
||||
(xit)-.15 E 1.458(status of the last command e)144 327.6 R -.15(xe)-.15
|
||||
G 1.458(cuted from).15 F F3(\214lename)3.958 E F0 6.458(.I).18 G(f)
|
||||
-6.458 E F3(\214lename)5.868 E F0 1.458
|
||||
(does not contain a slash, \214le-)4.138 F .608(names in)144 339.6 R/F4
|
||||
9/Times-Bold@0 SF -.666(PA)3.108 G(TH)-.189 E F0 .608
|
||||
(are used to \214nd the directory containing)2.858 F F3(\214lename)3.108
|
||||
E F0 5.608(.T).18 G .608(he \214le searched for in)-5.608 F F4 -.666(PA)
|
||||
3.108 G(TH)-.189 E F0 .832(need not be e)144 351.6 R -.15(xe)-.15 G
|
||||
3.332(cutable. When).15 F F2(bash)3.332 E F0 .832(is not in)3.332 F F3
|
||||
.832(posix mode)3.332 F F0 3.332(,t)C .833
|
||||
(he current directory is searched if no)-3.332 F .982
|
||||
(\214le is found in)144 363.6 R F4 -.666(PA)3.481 G(TH)-.189 E/F5 9
|
||||
/Times-Roman@0 SF(.)A F0 .981(If the)5.481 F F2(sour)3.481 E(cepath)-.18
|
||||
@@ -1126,13 +1127,15 @@ E(gin)-.1 E F0 .499(\(1\) does.).24 F(The)5.499 E F1<ad63>2.999 E F0
|
||||
.15 F(non-interacti)144 225.6 Q .876 -.15(ve s)-.25 H .576(hell e).15 F
|
||||
.576(xits, unless the)-.15 F F1(execfail)3.076 E F0 .577
|
||||
(shell option is enabled.)3.077 F .577(In that case, it returns f)5.577
|
||||
F(ail-)-.1 E 2.505(ure. An)144 237.6 R(interacti)2.505 E .305 -.15(ve s)
|
||||
-.25 H .005(hell returns f).15 F .005(ailure if the \214le cannot be e)
|
||||
-.1 F -.15(xe)-.15 G 2.505(cuted. If).15 F F2(command)2.705 E F0 .005
|
||||
(is not speci\214ed,)3.275 F(an)144 249.6 Q 3.036(yr)-.15 G .536
|
||||
(edirections tak)-3.036 F 3.036(ee)-.1 G -.25(ff)-3.036 G .536
|
||||
(ect in the current shell, and the return status is 0.).25 F .536
|
||||
(If there is a redirection)5.536 F(error)144 261.6 Q 2.5(,t)-.4 G
|
||||
F(ail-)-.1 E 3.32(ure. An)144 237.6 R(interacti)3.32 E 1.12 -.15(ve s)
|
||||
-.25 H .82(hell returns f).15 F .82(ailure if the \214le cannot be e)-.1
|
||||
F -.15(xe)-.15 G 3.32(cuted. A).15 F .82(subshell e)3.32 F .82
|
||||
(xits uncondi-)-.15 F .287(tionally if)144 249.6 R F1(exec)2.787 E F0
|
||||
-.1(fa)2.787 G 2.787(ils. If).1 F F2(command)2.987 E F0 .287
|
||||
(is not speci\214ed, an)3.557 F 2.788(yr)-.15 G .288(edirections tak)
|
||||
-2.788 F 2.788(ee)-.1 G -.25(ff)-2.788 G .288(ect in the current shell,)
|
||||
.25 F(and the return status is 0.)144 261.6 Q
|
||||
(If there is a redirection error)5 E 2.5(,t)-.4 G
|
||||
(he return status is 1.)-2.5 E F1(exit)108 278.4 Q F0([)2.5 E F2(n)A F0
|
||||
(])A .096(Cause the shell to e)144 278.4 R .096(xit with a status of)
|
||||
-.15 F F2(n)2.596 E F0 5.096(.I)C(f)-5.096 E F2(n)2.955 E F0 .095
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
%!PS-Adobe-3.0
|
||||
%%Creator: groff version 1.22.3
|
||||
%%CreationDate: Mon Jun 26 09:16:27 2017
|
||||
%%CreationDate: Wed Aug 23 16:02:43 2017
|
||||
%%DocumentNeededResources: font Times-Roman
|
||||
%%+ font Times-Bold
|
||||
%%DocumentSuppliedResources: procset grops 1.22 3
|
||||
|
||||
@@ -0,0 +1,556 @@
|
||||
## -*- sh -*-
|
||||
|
||||
# The psuedo-ksh autoloader.
|
||||
|
||||
# How to use:
|
||||
# o One function per file.
|
||||
# o File and function name match exactly.
|
||||
# o File is located in a directory that is in FPATH.
|
||||
# o This script (autoload) must be sourced in as early as possible. This
|
||||
# implies that any code in this script should NOT rely on any library of local
|
||||
# or self-defined functions having already been loaded.
|
||||
# o autoload must be called for each function before the function can be used. If
|
||||
# autoloads are in directories where there are nothing but autoloads, then
|
||||
# 'autoload /path/to/files/*' suffices (but see options -a and -f).
|
||||
# o The call must be made in the current environment, not a subshell.
|
||||
# o The command line suffices as "current environment". If you have autoload
|
||||
# calls in a script, that script must be dotted into the process.
|
||||
|
||||
# The first cut of this was by Bill Trost, trost@reed.bitnet.
|
||||
# The second cut came from Chet Ramey, chet@ins.CWRU.Edu
|
||||
# The third cut came from Mark Kennedy, mtk@ny.ubs.com. 1998/08/25
|
||||
# The fourth cut came from Matthew Persico, matthew.persico@gmail.com 2017/August
|
||||
|
||||
autoload_calc_shimsize ()
|
||||
{
|
||||
echo $((AUTOLOAD_SHIM_OVERHEAD + 3 * ${#1}))
|
||||
}
|
||||
|
||||
_autoload_split_fpath ()
|
||||
{
|
||||
(IFS=':'; set -- ${FPATH}; echo "$@")
|
||||
}
|
||||
|
||||
_aload()
|
||||
{
|
||||
local opt OPTIND
|
||||
local doexport=0
|
||||
local doreload=0
|
||||
local doverbose=0
|
||||
local doevalshim=0
|
||||
local loadthese
|
||||
local optimize=0
|
||||
local loaded=0
|
||||
local exported=0
|
||||
local optimized=0
|
||||
local summary=0
|
||||
local dofpath=0
|
||||
while getopts xrvla:oyf opt; do
|
||||
case $opt in
|
||||
x) doexport=1;;
|
||||
r) doreload=1;;
|
||||
v) doverbose=1;;
|
||||
l) doevalshim=1;;
|
||||
a) loadthese=$(find $OPTARG -maxdepth 1 -type f -printf '%f ');;
|
||||
o) optimize=1;;
|
||||
y) summary=1;;
|
||||
f) loadthese=$(find $(_autoload_split_fpath) -maxdepth 1 -type f -printf '%f ');;
|
||||
*) echo "_aload: usage: _aload [-xrvlyf] [-a dir] [function ...]" >&2; return;;
|
||||
esac
|
||||
done
|
||||
|
||||
shift $(($OPTIND-1))
|
||||
|
||||
[ -z "$loadthese" ] && loadthese="$@"
|
||||
|
||||
local func
|
||||
for func in $loadthese; do
|
||||
local exists_fn
|
||||
exists_fn=$(declare -F $func)
|
||||
if [ -n "$exists_fn" ] && ((doreload==0)) && ((doevalshim==0))
|
||||
then
|
||||
if ((doverbose))
|
||||
then
|
||||
echo "autoload: function '$func' already exists"
|
||||
fi
|
||||
else
|
||||
local andevaled=''
|
||||
local andexported=''
|
||||
local evalstat=0
|
||||
local doshim=1
|
||||
local funcfile
|
||||
funcfile=$(_autoload_resolve $func)
|
||||
if [[ $funcfile ]] ; then
|
||||
## The file was found for $func. Process it.
|
||||
|
||||
if ((optimize)); then
|
||||
## For the first function loaded, we will not know
|
||||
## AUTOLOAD_SHIM_OVERHEAD. We can only calculate it after
|
||||
## we have loaded one function.
|
||||
if [[ $AUTOLOAD_SHIM_OVERHEAD ]]; then
|
||||
local size=$(wc -c $funcfile| sed 's/ .*//')
|
||||
local shimsize=$(autoload_calc_shimsize $func)
|
||||
if (( size <= shimsize)); then
|
||||
doshim=0
|
||||
andevaled=', optimized'
|
||||
((optimized+=1))
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if ((doevalshim)); then
|
||||
doshim=0
|
||||
andevaled=', evaled'
|
||||
fi
|
||||
|
||||
## 'brand' as in branding a cow with a mark. We add a local
|
||||
## variable to each function we autoload so that we can tell
|
||||
## later on it is an autoloaded function without having to
|
||||
## maintain some bash array or hash that cannot be passed to
|
||||
## and used by subshells.
|
||||
local brandtext
|
||||
brandtext="eval \"\$(type $func | sed -e 1d -e 4ilocal\\ AUTOLOADED=\'$func\')\""
|
||||
if ((doshim)); then
|
||||
## Don't bother trying to save space by shoving all the
|
||||
## eval text below onto one unreadable line; new lines will
|
||||
## be added at your semicolons and any indentation below
|
||||
## seems to be ignored anyway if you export the function;
|
||||
## look at its BASH_FUNCTION representation.
|
||||
eval $func '()
|
||||
{
|
||||
local IS_SHIM="$func"
|
||||
local file=$(_autoload_resolve '$func')
|
||||
if [[ $file ]]
|
||||
then
|
||||
. $file
|
||||
'$brandtext'
|
||||
'$func' "$@"
|
||||
return $?
|
||||
else
|
||||
return 1;
|
||||
fi
|
||||
}'
|
||||
else
|
||||
. $funcfile
|
||||
eval "$brandtext"
|
||||
fi
|
||||
evalstat=$?
|
||||
if((evalstat==0))
|
||||
then
|
||||
((loaded+=1))
|
||||
((doexport)) && export -f $func && andexported=', exported' && ((exported+=1))
|
||||
((doverbose)) && echo "$func autoloaded${andexported}${andevaled}"
|
||||
if [[ ! $AUTOLOAD_SHIM_OVERHEAD ]] && ((doshim)); then
|
||||
## ...we have just loaded the first function shim into
|
||||
## memory. Let's calc the AUTOLOAD_SHIM_OVERHEAD size
|
||||
## to use going forward. In theory, we could check
|
||||
## again here to see if we should optimize and source
|
||||
## in this function, now that we now the
|
||||
## AUTOLOAD_SHIM_OVERHEAD. In practice, it's not worth
|
||||
## duping that code or creating a function to do so for
|
||||
## one function.
|
||||
AUTOLOAD_SHIM_OVERHEAD=$(type $func | grep -v -E "^$1 is a function" | sed "s/$func//g"| wc -c)
|
||||
export AUTOLOAD_SHIM_OVERHEAD
|
||||
fi
|
||||
else
|
||||
echo "$func failed to load" >&2
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
((summary)) && echo "autoload: loaded:$loaded exported:$exported optimized:$optimized overhead:$AUTOLOAD_SHIM_OVERHEAD bytes"
|
||||
}
|
||||
|
||||
_autoload_dump()
|
||||
{
|
||||
local opt OPTIND
|
||||
local opt_p=''
|
||||
local opt_s=''
|
||||
while getopts ps opt
|
||||
do
|
||||
case $opt in
|
||||
p ) opt_p=1;;
|
||||
s ) opt_s=1;;
|
||||
esac
|
||||
done
|
||||
|
||||
shift $(($OPTIND-1))
|
||||
|
||||
local exported=''
|
||||
local executed=''
|
||||
local func
|
||||
for func in $(declare | grep -E 'local\\{0,1} AUTOLOADED' | sed -e "s/.*AUTOLOADED=//" -e 's/\\//g' -e 's/[");]//g' -e "s/'//g")
|
||||
do
|
||||
if [ -n "$opt_p" ]; then echo -n "autoload "; fi
|
||||
if [ -n "$opt_s" ]
|
||||
then
|
||||
exported=$(declare -F | grep -E "${func}$" | sed 's/declare -f\(x\{0,1\}\).*/\1/')
|
||||
[ "$exported" = 'x' ] && exported=' exported' || exported=' not exported'
|
||||
executed=$(type $func | grep 'local IS_SHIM')
|
||||
[ -z "$executed" ] && executed=' executed' || executed=' not executed'
|
||||
fi
|
||||
echo "${func}${exported}${executed}"
|
||||
done
|
||||
}
|
||||
|
||||
_autoload_resolve()
|
||||
{
|
||||
if [[ ! "$FPATH" ]]; then
|
||||
echo "autoload: FPATH not set or null" >&2
|
||||
return
|
||||
fi
|
||||
|
||||
local p # for 'path'. The $() commands in the for loop split the FPATH
|
||||
# string into its constituents so that each one may be processed.
|
||||
|
||||
for p in $( _autoload_split_fpath ); do
|
||||
p=${p:-.}
|
||||
if [ -f $p/$1 ]; then echo $p/$1; return; fi
|
||||
done
|
||||
|
||||
echo "autoload: $1: function source file not found" >&2
|
||||
}
|
||||
|
||||
_autoload_edit()
|
||||
{
|
||||
[ -z "$EDITOR" ] && echo "Error: no EDITOR defined" && return 1
|
||||
local toedit
|
||||
local func
|
||||
for func in "$@"
|
||||
do
|
||||
local file=$(_autoload_resolve $func)
|
||||
if [[ $file ]]
|
||||
then
|
||||
toedit="$toedit $file"
|
||||
else
|
||||
echo "$funcname not found in FPATH funcfile. Skipping."
|
||||
fi
|
||||
done
|
||||
|
||||
[ -z "$toedit" ] && return 1
|
||||
|
||||
local timemarker=$(mktemp)
|
||||
|
||||
$EDITOR $toedit
|
||||
|
||||
local i
|
||||
for i in $toedit
|
||||
do
|
||||
if [ $i -nt $timemarker ]
|
||||
then
|
||||
local f=$(basename $i)
|
||||
echo Reloading $f
|
||||
autoload -r $f
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
_autoload_page()
|
||||
{
|
||||
[ -z "$PAGER" ] && echo "Error: no PAGER defined" && return 1
|
||||
local topage
|
||||
local func
|
||||
for func in "$@"
|
||||
do
|
||||
local file=$(_autoload_resolve $func)
|
||||
if [[ $file ]]
|
||||
then
|
||||
topage="$topage $file"
|
||||
else
|
||||
echo "$funcname not found in FPATH funcfile. Skipping."
|
||||
fi
|
||||
done
|
||||
|
||||
[ -z "$topage" ] && return 1
|
||||
|
||||
$PAGER $topage
|
||||
}
|
||||
|
||||
_autoload_remove()
|
||||
{
|
||||
unset -f "$@"
|
||||
}
|
||||
|
||||
_autoload_help()
|
||||
{
|
||||
cat <<EOH
|
||||
NAME
|
||||
autoload
|
||||
|
||||
SYNOPSIS
|
||||
autoload [-ps]
|
||||
autoload [-xuremloyv] [function ...]
|
||||
autoload -a directory [-oyv]
|
||||
autoload -f [-oyv]
|
||||
autoload [-h]
|
||||
|
||||
autoreload [function ...]
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
An implementation of the 'autoload' functionality built into other
|
||||
shells, of which 'ksh' is the most prominent. It allows for a keeping
|
||||
the process environment small by loading small 'shim' functions into
|
||||
memory that will, on first call, load the full text of the given
|
||||
function and run it. Subsequent calls to the function just run the
|
||||
function.
|
||||
|
||||
'autoreload' is a synonym for 'autoload -r'. See below.
|
||||
|
||||
USAGE
|
||||
|
||||
o Each function to be autoloaded should be defined in a single file,
|
||||
named exactly the same as the function.
|
||||
|
||||
o In order to avoid side effects, do NOT put code other than the
|
||||
function definition in the file. Unless of course you want to do some
|
||||
one-time initialization. But beware that if you reload the function
|
||||
for any reason, you will rerun the initialization code. Make sure
|
||||
your initialization is re-entrant. Or, better yet,
|
||||
|
||||
*** do NOT put code other than the function definition in the file ***
|
||||
|
||||
o These function definition files should be placed in a directory that
|
||||
is in the FPATH environment variable. Subdirectories are NOT scanned.
|
||||
|
||||
o The autoload script should be sourced into the current process as
|
||||
early as possible in process start up. See NOTES below for
|
||||
suggestions.
|
||||
|
||||
o The calls to the autoload function must be made in the current
|
||||
process. If your calls are in their own script, that script must be
|
||||
sourced in. Command line invocations are also sufficient. (But see
|
||||
'-l' below.)
|
||||
|
||||
o The first time the function is called, the shim function that was
|
||||
created by the 'autoload' call is what is executed. This function
|
||||
then goes and finds the appropriate file in FPATH, sources it in and
|
||||
then calls the actual function with any arguments you just passed in
|
||||
to the shim function. Subsequent calls just run the function.
|
||||
|
||||
OPTIONS
|
||||
|
||||
-a Autoload (a)ll the functions found in the given directory.
|
||||
|
||||
-f Autoload all the functions found in all the directories on the
|
||||
FPATH.
|
||||
|
||||
-p Print all the autoloaded functions.
|
||||
|
||||
-s Print all the autoloaded functions and add their export status.
|
||||
|
||||
-x Export the specified functions to the environment for use in
|
||||
subshells.
|
||||
|
||||
-u Unset the function, so it can be reloaded.
|
||||
|
||||
-r Reload the shims of the specified functions, even if the functions
|
||||
have been already been executed. This will allow you to modify the
|
||||
functions' source and have the new version executed next time the
|
||||
function is called.
|
||||
|
||||
It would be very easy to modify a function's script, run the
|
||||
function and scratch your head for a long time trying to figure out
|
||||
why your changes are not being executed. That's why we provide the
|
||||
'-e' flag described below for modifications.
|
||||
|
||||
Reloads, of course, only apply in the context of the current session
|
||||
and any future subshell you start from the current session. Existing
|
||||
sessions will need to have the same 'autoload -r' command run in
|
||||
them.
|
||||
|
||||
-e Find the scripts in which the specified functions are defined and
|
||||
start up \$EDITOR on those scripts. Reload the ones that were
|
||||
modified when you exit \$EDITOR. (Note: If you use 'autoload -e foo'
|
||||
to edit function 'foo', and then in your editor you separately load
|
||||
up function 'bar', 'autoload' has no way of knowing that you edited
|
||||
'bar' and will NOT reload 'bar' for you.)
|
||||
|
||||
Reloads, of course, only apply in the context of the current session
|
||||
and any future subshell you start from the current session. Existing
|
||||
sessions will need to have the same 'autoload -r' command run in
|
||||
them.
|
||||
|
||||
-m Find the scripts in which the specified functions are defined and
|
||||
run \$PAGER on them ('m' is for 'more', because 'p' (page) and 'l'
|
||||
(load) are already used as options in 'autoload').
|
||||
|
||||
-l When autoloading a function, eval the shim immediately in order to
|
||||
load the true function code. See "Using '-l'" in the NOTES below for
|
||||
details.
|
||||
|
||||
-o Optimize. When autoloading, take the time to execute
|
||||
|
||||
'theCharCount=\$(wc -c \$theFuncFile)'
|
||||
|
||||
for each funcion and
|
||||
|
||||
if \$theCharCount < \$AUTOLOAD_SHIM_OVERHEAD
|
||||
|
||||
don't shim it, just eval directly.
|
||||
|
||||
-y Summar(y). Print the number of loaded, exported and optimized
|
||||
functions.
|
||||
|
||||
-v Turns up the chattiness.
|
||||
|
||||
NOTES
|
||||
|
||||
o Calling 'autoload' on a function that already exists (either shimmed
|
||||
or expanded) silently ignores the request to load the shim unless it
|
||||
has been previously removed (-u) or you force the reload (-r).
|
||||
|
||||
o Changing and reloading a function that has been exported does not
|
||||
require it be re-exported; the modifications will appear in
|
||||
subsequent subshells.
|
||||
|
||||
o Using '-1'
|
||||
|
||||
If you are running under set -x and/or set -v, you may see that the
|
||||
shim does not appear to "work"; instead of seeing the shim first and
|
||||
the real code subsequently, you may see the shim evaluated multiple
|
||||
times.
|
||||
|
||||
This may not be an error; review your code. What is most likely
|
||||
happening is that you are calling the function in subshells via
|
||||
backticks or $(), or in a script that is not being sourced into the
|
||||
current environment. If you have not previously called the function
|
||||
in question at your command line or in a script that was sourced into
|
||||
the current envirnoment, then the various subshells are going to
|
||||
encounter the shim and replace with the real code before executing.
|
||||
|
||||
Remember, however, that environment modifications that occur in a
|
||||
subshell are NOT propagated back to the calling shell or over to any
|
||||
sibling shells. So, if you call an autoloaded function in a very
|
||||
tight loop of very many subshells, you may want to make an 'autoload
|
||||
-l' call before you start your loop. '-l' will instruct 'autoload' to
|
||||
bypass the shim creation and just source in the function's file
|
||||
directly. For a few calls, the overhead of repeatedly running the
|
||||
shim is not expensive, but in a tight loop, it might be. Caveat
|
||||
Programer.
|
||||
|
||||
o Although the number of functions in the environment does not change
|
||||
by using 'autoload', the amount of memory they take up can be greatly
|
||||
reduced, depending on the size of your functions. If you have a lot
|
||||
of small functions, then it is possible that the shim text will be
|
||||
larger than your actual functions, rendering the memory savings moot.
|
||||
|
||||
'small' in this case can be determined by calling the function
|
||||
'autoload_calc_shimsize' with the name of the function to determine
|
||||
its shim size.
|
||||
|
||||
o In order to support the -p and -s options, we need a way to determine
|
||||
if a function 'func' has been autoloaded or if it was loaded
|
||||
diredctly. In order to do that, we modify the function's code by
|
||||
adding the text
|
||||
|
||||
local AUTOLOADED='func';
|
||||
|
||||
to the shim and to the actual function text, just after the opening
|
||||
brace. Then supporting -p and -s is just a matter of grepping through
|
||||
all the function text in memory. Even though grepping through the
|
||||
environment may not be the most efficient way to support this, it is
|
||||
the simplest to implement for -p and -s operations that are not
|
||||
heavily used.
|
||||
|
||||
As a consquence of this (and other reasons), the AUTOLOAD* namespace
|
||||
is reserved for autoloading. Make sure you check any functions that
|
||||
you bring under autoload for use of variables or functions that start
|
||||
with AUTOLOAD and change them.
|
||||
|
||||
o The easiest way to load shims for all functions on the FPATH is to run
|
||||
|
||||
autoload -f -x
|
||||
|
||||
in the profile that gets run for login shells.
|
||||
|
||||
When called in the profile of a login shell where no definitions
|
||||
exist, -f will load all functions it can find on FPATH and -x will
|
||||
export all of those functions to be available in subshells when this
|
||||
is called in a login shell. Using this option will relieve you of the
|
||||
need to call 'autoload' after Every Single Function Definition, nor
|
||||
will you need to call it in subshells.
|
||||
|
||||
The only thing left to do is to load up the autoload function itself
|
||||
and its helper functions. That needs to happen in your profile:
|
||||
|
||||
export FPATH=~/functions # or wherever you stash them
|
||||
if [ -z $(declare -F autoload) ]
|
||||
then
|
||||
. ~/bin/autoload # or wherever you've put it
|
||||
fi
|
||||
|
||||
The 'if' statement is used to make sure we don't reload autoload
|
||||
needlessly. Sourcing in the autoload script loads the 'autoload'
|
||||
function and all of its support functions. Additionally, we export
|
||||
all of these functions so that they are available in subshells; you
|
||||
do not have to re-source the autoload file in '.bashrc'.
|
||||
|
||||
o Even with all of these shenanigans, you will find cases where no
|
||||
matter how hard you try, your autoloaded functions will be
|
||||
unavailable to you, even if you run 'autoload -x -f'. The typical
|
||||
condition for this is starting up not a subshell, but a brand new
|
||||
DIFFERENT shell. And the typical example of this is git extentions.
|
||||
|
||||
At the time of this writing, git extentions work by taking a command
|
||||
'git foo' and looking for a file 'git-foo' on the path. 'git' then
|
||||
executes 'git-foo' in a new shell - it executes your command in
|
||||
/bin/sh. That's not a subshell of your process. It will not get your
|
||||
exported shell functions. Ballgame over.
|
||||
|
||||
If you find that you want your functions to be available in such
|
||||
circumstances, convert them back to plain old scripts, make sure they
|
||||
are 'sh' compliant and take the read/parse hit every time they are
|
||||
run.
|
||||
|
||||
EOH
|
||||
}
|
||||
|
||||
autoload()
|
||||
{
|
||||
if (( $# == 0 )) ; then _autoload_dump; return; fi
|
||||
|
||||
local opt OPTIND OPTARG
|
||||
local passthru
|
||||
local dumpopt
|
||||
while getopts psuema:yxrvlohf opt
|
||||
do
|
||||
case $opt in
|
||||
p|s) dumpopt="$dumpopt -${opt}";;
|
||||
u) shift $((OPTIND-1)); _autoload_remove "$@"; return;;
|
||||
e) shift $((OPTIND-1)); _autoload_edit "$@"; return;;
|
||||
m) shift $((OPTIND-1)); _autoload_page "$@"; return;;
|
||||
x|r|v|l|y|f|o) passthru="$passthru -$opt";;
|
||||
a) passthru="$passthru -$opt $OPTARG";;
|
||||
h) _autoload_help; return;;
|
||||
*) echo "autoload: usage: autoload [-puUx] [function ...]" >&2; return;;
|
||||
esac
|
||||
done
|
||||
|
||||
shift $(($OPTIND-1))
|
||||
if [ -n "$dumpopt" ]
|
||||
then
|
||||
_autoload_dump $dumpopt
|
||||
else
|
||||
_aload $passthru "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
autoreload ()
|
||||
{
|
||||
autoload -r "$@"
|
||||
}
|
||||
|
||||
## When we source in autoload, we export (but NOT autoload) the autoload
|
||||
## functions so that they are available in subshells and you don't have to
|
||||
## source in the autoload file in subshells.
|
||||
export -f _aload \
|
||||
_autoload_dump \
|
||||
_autoload_edit \
|
||||
_autoload_help \
|
||||
_autoload_page \
|
||||
_autoload_resolve \
|
||||
_autoload_split_fpath \
|
||||
autoload \
|
||||
autoload_calc_shimsize \
|
||||
autoreload
|
||||
@@ -0,0 +1,184 @@
|
||||
#!/bin/bash
|
||||
|
||||
workdir=$(mktemp -d)
|
||||
|
||||
cp autoload $workdir
|
||||
|
||||
cd $workdir
|
||||
pwd
|
||||
|
||||
. ./autoload
|
||||
|
||||
funclist='ALTEST_func1 ALTEST_funcexport ALTEST_funcu'
|
||||
for funcname in $funclist; do
|
||||
cat <<EOFFUNC > $funcname
|
||||
$funcname ()
|
||||
{
|
||||
echo this is $funcname
|
||||
|
||||
}
|
||||
EOFFUNC
|
||||
|
||||
done
|
||||
|
||||
export FPATH=$workdir
|
||||
|
||||
autoload ALTEST_func1 ALTEST_funcu
|
||||
autoload -x ALTEST_funcexport
|
||||
|
||||
ok=0
|
||||
failed=0
|
||||
|
||||
for funcname in $funclist; do
|
||||
|
||||
testname="$funcname loaded"
|
||||
got=$(type $funcname 2>&1)
|
||||
if [[ $got =~ "$funcname: not found" ]]; then
|
||||
echo "## Failed $testname"
|
||||
((failed+=1))
|
||||
else
|
||||
echo "ok - $testname"
|
||||
((ok+=1))
|
||||
|
||||
testname="$funcname is a shim"
|
||||
if [[ ! $got =~ "IS_SHIM" ]]; then
|
||||
echo "## Failed $testname"
|
||||
((failed+=1))
|
||||
else
|
||||
echo "ok - $testname"
|
||||
((ok+=1))
|
||||
|
||||
testname="$funcname shim executed"
|
||||
$funcname > /dev/null
|
||||
got=$(type $funcname 2>&1)
|
||||
if [[ $got =~ "IS_SHIM" ]]; then
|
||||
echo "## Failed $testname"
|
||||
((failed+=1))
|
||||
else
|
||||
echo "ok - $testname"
|
||||
((ok+=1))
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
funcname=ALTEST_func1
|
||||
testname="$funcname shim reloaded"
|
||||
autoload -r $funcname
|
||||
got=$(type $funcname 2>&1)
|
||||
if [[ ! $got =~ "IS_SHIM" ]]; then
|
||||
echo "## Failed $testname"
|
||||
((failed+=1))
|
||||
else
|
||||
echo "ok - $testname"
|
||||
((ok+=1))
|
||||
fi
|
||||
|
||||
funcname=ALTEST_funcu
|
||||
testname="$funcname shim unloaded"
|
||||
autoload -u $funcname
|
||||
got=$(type $funcname 2>&1)
|
||||
if [[ ! $got =~ "$funcname: not found" ]]; then
|
||||
echo "## Failed $testname"
|
||||
((failed+=1))
|
||||
else
|
||||
echo "ok - $testname"
|
||||
((ok+=1))
|
||||
fi
|
||||
|
||||
testname="autoload -p"
|
||||
got=$(autoload -p | grep ALTEST)
|
||||
if [[ ! $got =~ "autoload ALTEST_func1" ]] || \
|
||||
[[ ! $got =~ "autoload ALTEST_funcexport" ]] ; then
|
||||
echo "## Failed $testname"
|
||||
((failed+=1))
|
||||
else
|
||||
echo "ok - $testname"
|
||||
((ok+=1))
|
||||
fi
|
||||
|
||||
testname="autoload -s"
|
||||
echo "Executing $testname, could take a long time..."
|
||||
got=$(autoload -s | grep ALTEST)
|
||||
if [[ ! $got =~ "ALTEST_func1 not exported not executed" ]] || \
|
||||
[[ ! $got =~ "ALTEST_funcexport exported executed" ]] ; then
|
||||
echo "## Failed $testname"
|
||||
echo "## got: $got"
|
||||
((failed+=1))
|
||||
else
|
||||
echo "ok - $testname"
|
||||
((ok+=1))
|
||||
fi
|
||||
|
||||
testname="autoload -r -a $FPATH"
|
||||
autoload -r -a $FPATH
|
||||
localfailed=0
|
||||
localok=0
|
||||
for funcname in $funclist; do
|
||||
got=$(type $funcname 2>&1)
|
||||
if [[ $got =~ "$funcname: not found" ]]; then
|
||||
echo "## Failed $testname - $funcname"
|
||||
((localfailed+=1))
|
||||
else
|
||||
((localok+=1))
|
||||
if [[ ! $got =~ "IS_SHIM" ]]; then
|
||||
((localfailed+=1))
|
||||
else
|
||||
((localok+=1))
|
||||
fi
|
||||
fi
|
||||
done
|
||||
if ((localfailed==0)); then
|
||||
echo "ok - $testname"
|
||||
((ok+=1))
|
||||
else
|
||||
((failed+=1))
|
||||
fi
|
||||
|
||||
testname="autoload -u $funclist"
|
||||
autoload -u $funclist
|
||||
localfailed=0
|
||||
localok=0
|
||||
for funcname in $funclist; do
|
||||
got=$(type $funcname 2>&1)
|
||||
if [[ ! $got =~ "$funcname: not found" ]]; then
|
||||
echo "## Failed $testname - $funcname"
|
||||
((localfailed+=1))
|
||||
else
|
||||
((localok+=1))
|
||||
fi
|
||||
done
|
||||
if ((localfailed==0)); then
|
||||
echo "ok - $testname"
|
||||
((ok+=1))
|
||||
else
|
||||
((failed+=1))
|
||||
fi
|
||||
|
||||
testname="autoload -r -f"
|
||||
autoload -r -f
|
||||
localfailed=0
|
||||
localok=0
|
||||
for funcname in $funclist; do
|
||||
got=$(type $funcname 2>&1)
|
||||
if [[ $got =~ "$funcname: not found" ]]; then
|
||||
echo "## Failed $testname - $funcname"
|
||||
((localfailed+=1))
|
||||
else
|
||||
((localok+=1))
|
||||
if [[ ! $got =~ "IS_SHIM" ]]; then
|
||||
((localfailed+=1))
|
||||
else
|
||||
((localok+=1))
|
||||
fi
|
||||
fi
|
||||
done
|
||||
if ((localfailed==0)); then
|
||||
echo "ok - $testname"
|
||||
((ok+=1))
|
||||
else
|
||||
((failed+=1))
|
||||
fi
|
||||
|
||||
echo $ok passed, $failed failed
|
||||
exit $failed
|
||||
+4171
File diff suppressed because it is too large
Load Diff
+417
-402
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+425
-403
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+633
-567
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+1583
-954
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+733
-544
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+423
-403
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user