| 1 |
<para>This index / glossary / quick-reference lists many of the |
| 2 |
important topics covered in the text. Terms are arranged |
| 3 |
in <emphasis>approximate</emphasis> ASCII sorting order, |
| 4 |
<emphasis>modified as necessary</emphasis> for enhanced |
| 5 |
clarity.</para> |
| 6 |
|
| 7 |
<para>Note that <emphasis>commands</emphasis> are indexed |
| 8 |
in <link linkend="part4A">Part 4</link>.</para> |
| 9 |
|
| 10 |
<para>* * *</para> |
| 11 |
|
| 12 |
<!-- Characters and symbols --> |
| 13 |
<para><command>^ </command> (caret) |
| 14 |
<itemizedlist> |
| 15 |
<listitem> |
| 16 |
<para> |
| 17 |
<link linkend="beglineref">Beginning-of-line</link>, |
| 18 |
in a <link linkend="regexref">Regular Expression</link> |
| 19 |
</para> |
| 20 |
</listitem> |
| 21 |
|
| 22 |
<listitem> |
| 23 |
<para><command>^</command></para> |
| 24 |
<para><command>^^</command></para> |
| 25 |
<para><link linkend="casemodparamsub">Uppercase |
| 26 |
conversion</link> in <firstterm>parameter |
| 27 |
substitution</firstterm></para> |
| 28 |
</listitem> |
| 29 |
</itemizedlist> |
| 30 |
</para> |
| 31 |
|
| 32 |
<para><command>~ </command> <firstterm>Tilde</firstterm> |
| 33 |
<itemizedlist> |
| 34 |
|
| 35 |
<listitem><para> |
| 36 |
<command>~ </command> |
| 37 |
<link linkend="tilderef">home directory</link>, corresponds |
| 38 |
to <link |
| 39 |
linkend="homedirref"><varname>$HOME</varname></link> |
| 40 |
</para></listitem> |
| 41 |
|
| 42 |
<!-- ********************** --> |
| 43 |
|
| 44 |
<listitem><para> |
| 45 |
<command>~/ </command> |
| 46 |
<link linkend="tilderef"> <firstterm>Current user's</firstterm> |
| 47 |
home directory</link> |
| 48 |
</para></listitem> |
| 49 |
|
| 50 |
<listitem><para> |
| 51 |
<command>~+ </command> |
| 52 |
<link linkend="workingdirref"><emphasis>Current</emphasis> |
| 53 |
working directory</link> |
| 54 |
</para></listitem> |
| 55 |
|
| 56 |
<listitem><para> |
| 57 |
<command>~- </command> |
| 58 |
<link linkend="prevworkingdir"><emphasis>Previous</emphasis> |
| 59 |
working directory</link> |
| 60 |
</para></listitem> |
| 61 |
|
| 62 |
</itemizedlist> |
| 63 |
</para> |
| 64 |
|
| 65 |
<!-- ********************** --> |
| 66 |
|
| 67 |
<para><command>= </command> <firstterm>Equals</firstterm> sign |
| 68 |
<itemizedlist> |
| 69 |
|
| 70 |
<listitem><para> |
| 71 |
<command>= </command> |
| 72 |
<link linkend="eqref">Variable assignment</link> operator |
| 73 |
</para></listitem> |
| 74 |
|
| 75 |
<listitem><para> |
| 76 |
<command>= </command> |
| 77 |
<link linkend="scomparison1">String comparison</link> operator |
| 78 |
</para> |
| 79 |
<para> |
| 80 |
<command>== </command> |
| 81 |
<link linkend="scomparison2">String comparison</link> operator |
| 82 |
</para></listitem> |
| 83 |
|
| 84 |
<listitem> |
| 85 |
<para> |
| 86 |
<command>=~ </command> |
| 87 |
<firstterm>Regular Expression</firstterm> |
| 88 |
<link linkend="regexmatchref">match</link> operator |
| 89 |
</para> |
| 90 |
<para><link linkend="findsplit0"><firstterm>Example |
| 91 |
script</firstterm></link></para> |
| 92 |
</listitem> |
| 93 |
|
| 94 |
</itemizedlist> |
| 95 |
</para> |
| 96 |
|
| 97 |
|
| 98 |
<!-- ********************** --> |
| 99 |
|
| 100 |
|
| 101 |
<para><command>< </command> Left angle bracket |
| 102 |
<itemizedlist> |
| 103 |
|
| 104 |
<listitem><para>Is-less-than</para> |
| 105 |
<para><link linkend="ltref">String comparison</link></para> |
| 106 |
<para> |
| 107 |
<link linkend="intlt">Integer comparison</link> within |
| 108 |
<link linkend="dblparens">double parentheses</link> |
| 109 |
</para></listitem> |
| 110 |
|
| 111 |
|
| 112 |
<listitem><para>Redirection</para> |
| 113 |
|
| 114 |
<para> |
| 115 |
<command>< </command> |
| 116 |
<link linkend="ioredirectionref2"><filename>stdin</filename></link> |
| 117 |
</para> |
| 118 |
<para> |
| 119 |
<command><< </command> |
| 120 |
<link linkend="heredocrrref"><firstterm>Here document</firstterm></link> |
| 121 |
</para> |
| 122 |
<para> |
| 123 |
<command><<< </command> |
| 124 |
<link linkend="herestringref"><firstterm>Here string</firstterm></link> |
| 125 |
</para> |
| 126 |
<para> |
| 127 |
<command><> </command> |
| 128 |
<link linkend="redirrw">Opening a file</link> for |
| 129 |
<emphasis>both</emphasis> reading and writing |
| 130 |
</para></listitem> |
| 131 |
|
| 132 |
</itemizedlist> |
| 133 |
</para> |
| 134 |
|
| 135 |
<!-- ********************** --> |
| 136 |
|
| 137 |
<para><command>> </command> Right angle bracket |
| 138 |
<itemizedlist> |
| 139 |
|
| 140 |
<listitem><para>Is-greater-than</para> |
| 141 |
<para><link linkend="gtref">String comparison</link></para> |
| 142 |
<para><link linkend="intgt">Integer comparison</link>, |
| 143 |
within <firstterm>double parentheses</firstterm> |
| 144 |
</para></listitem> |
| 145 |
|
| 146 |
<!-- *** --> |
| 147 |
<listitem><para>Redirection</para> |
| 148 |
|
| 149 |
<para><command>> </command> |
| 150 |
<link linkend="ioredirectionref">Redirect |
| 151 |
<filename>stdout</filename></link> to a file |
| 152 |
</para> |
| 153 |
<para> |
| 154 |
<command>>> </command> |
| 155 |
<link linkend="ioredirectionref">Redirect |
| 156 |
<filename>stdout</filename></link> to a file, |
| 157 |
but <firstterm>append</firstterm> |
| 158 |
</para> |
| 159 |
|
| 160 |
<para><command>i>&j </command> |
| 161 |
<link linkend="ioredirectionref1">Redirect |
| 162 |
<firstterm>file descriptor</firstterm> |
| 163 |
<filename>i</filename></link> to |
| 164 |
<firstterm>file descriptor</firstterm> |
| 165 |
<filename>j</filename></para> |
| 166 |
<para> |
| 167 |
<command>>&j </command> |
| 168 |
<link linkend="ioredirectionref1">Redirect |
| 169 |
<filename>stdout</filename></link> to |
| 170 |
<firstterm>file descriptor</firstterm> |
| 171 |
<filename>j</filename></para> |
| 172 |
<para> |
| 173 |
<command>>&2 </command> |
| 174 |
<link linkend="redirouterror2">Redirect |
| 175 |
<filename>stdout</filename></link> of a command to |
| 176 |
<filename>stderr</filename></para> |
| 177 |
<para> |
| 178 |
<command>2>&1 </command> |
| 179 |
<link linkend="ioredirectionref1">Redirect |
| 180 |
<filename>stderr</filename></link> |
| 181 |
to <filename>stdout</filename></para> |
| 182 |
<para> |
| 183 |
<command>&> </command> |
| 184 |
<link linkend="redirouterror">Redirect |
| 185 |
<emphasis>both</emphasis> <filename>stdout</filename> |
| 186 |
and <filename>stderr</filename></link> of a command to a |
| 187 |
file</para> |
| 188 |
|
| 189 |
<para><command>:> <filename>file</filename></command> |
| 190 |
<link linkend="ioredirectionref">Truncate file</link> |
| 191 |
to zero length</para> |
| 192 |
|
| 193 |
</listitem> |
| 194 |
|
| 195 |
</itemizedlist> |
| 196 |
</para> |
| 197 |
|
| 198 |
<!-- ********************** --> |
| 199 |
|
| 200 |
<para><command>| </command> |
| 201 |
<link linkend="piperef">Pipe</link>, a device for passing the output |
| 202 |
of a command to another command or to the shell</para> |
| 203 |
<para><command>|| </command> |
| 204 |
<link linkend="orref">Logical OR test operator</link></para> |
| 205 |
|
| 206 |
<!-- ********************** --> |
| 207 |
|
| 208 |
<para><command>- </command> (dash) |
| 209 |
<itemizedlist> |
| 210 |
|
| 211 |
<listitem><para> |
| 212 |
<link linkend="defparam1">Prefix to <firstterm>default |
| 213 |
parameter</firstterm></link>, in <firstterm>parameter |
| 214 |
substitution</firstterm></para></listitem> |
| 215 |
<listitem><para> |
| 216 |
<link linkend="dashref">Prefix to <firstterm>option |
| 217 |
flag</firstterm></link></para></listitem> |
| 218 |
|
| 219 |
<listitem><para> |
| 220 |
<link linkend="dashref2">Indicating |
| 221 |
<firstterm>redirection</firstterm></link> from |
| 222 |
<filename>stdin</filename> or <filename>stdout</filename> |
| 223 |
</para></listitem> |
| 224 |
|
| 225 |
<listitem> |
| 226 |
<para><command>-- </command> (double-dash)</para> |
| 227 |
<para><link linkend="doubledashref">Prefix to |
| 228 |
<firstterm>long</firstterm> command options</link></para> |
| 229 |
<para> |
| 230 |
<link linkend="plusplusref"><firstterm>C-style</firstterm> |
| 231 |
variable decrement</link> within <link linkend="dblparensref">double |
| 232 |
parentheses</link> |
| 233 |
</para></listitem> |
| 234 |
|
| 235 |
</itemizedlist> |
| 236 |
</para> |
| 237 |
|
| 238 |
<!-- ********************** --> |
| 239 |
|
| 240 |
<para><command>; </command> (semicolon) |
| 241 |
<itemizedlist> |
| 242 |
<listitem><para><link linkend="semicolonref">As command |
| 243 |
separator</link></para></listitem> |
| 244 |
<listitem><para><command>\; </command> |
| 245 |
<link linkend="findref0"><firstterm>Escaped</firstterm> semicolon</link>, |
| 246 |
terminates a <link linkend="findref">find</link> |
| 247 |
command</para></listitem> |
| 248 |
<listitem><para><command>;; </command> |
| 249 |
<link linkend="doublesemicolon">Double-semicolon</link>, terminator in a |
| 250 |
<link linkend="caseesac1">case</link> option</para> |
| 251 |
|
| 252 |
<para>Required when ...</para> |
| 253 |
<para><link linkend="needsemicolon"><firstterm>do</firstterm> |
| 254 |
keyword is on the first line of |
| 255 |
<firstterm>loop</firstterm></link></para> |
| 256 |
<para><link linkend="omitsemicolon"> |
| 257 |
terminating <firstterm>curly-bracketed</firstterm> |
| 258 |
code block</link></para> |
| 259 |
</listitem> |
| 260 |
|
| 261 |
<listitem><para><command>;;&</command> <command>;&</command> |
| 262 |
<link linkend="ncterm">Terminators</link> in |
| 263 |
a <firstterm>case</firstterm> option (<link |
| 264 |
linkend="bash4ref">version 4+</link> of Bash).</para></listitem> |
| 265 |
|
| 266 |
</itemizedlist></para> |
| 267 |
|
| 268 |
|
| 269 |
<para><command>:</command> Colon |
| 270 |
<itemizedlist> |
| 271 |
|
| 272 |
<listitem><para> |
| 273 |
<command>:> <filename>filename</filename></command> |
| 274 |
<link linkend="ioredirectionref">Truncate file</link> |
| 275 |
to zero length</para></listitem> |
| 276 |
|
| 277 |
<listitem><para><link |
| 278 |
linkend="nullref"><firstterm>null</firstterm> |
| 279 |
command</link>, equivalent to the |
| 280 |
<link linkend="trueref">true</link> Bash |
| 281 |
builtin</para></listitem> |
| 282 |
|
| 283 |
<listitem><para>Used in an <link linkend="anonheredoc0">anonymous |
| 284 |
here document</link></para></listitem> |
| 285 |
|
| 286 |
<listitem><para>Used in an <link linkend="coloninfunction">otherwise |
| 287 |
empty function</link></para></listitem> |
| 288 |
|
| 289 |
<listitem><para>Used as a <link linkend="fstrangeref">function |
| 290 |
name</link></para></listitem> |
| 291 |
|
| 292 |
</itemizedlist></para> |
| 293 |
|
| 294 |
|
| 295 |
|
| 296 |
<para><command>! </command> |
| 297 |
<link linkend="notref">Negation operator</link>, inverts <link |
| 298 |
linkend="negcond">exit status</link> of a test or command |
| 299 |
<itemizedlist> |
| 300 |
<listitem><para><command>!= </command> |
| 301 |
<link linkend="notequal">not-equal-to</link> |
| 302 |
String comparison operator</para></listitem> |
| 303 |
</itemizedlist></para> |
| 304 |
|
| 305 |
<!-- ********************** --> |
| 306 |
<para><command>? </command> (question mark) |
| 307 |
<itemizedlist> |
| 308 |
|
| 309 |
<listitem><para> |
| 310 |
<link linkend="quexregex">Match zero or one characters</link>, |
| 311 |
in an <link linkend="extregex"> Extended Regular |
| 312 |
Expression</link></para></listitem> |
| 313 |
<listitem><para><link linkend="quexwc">Single-character |
| 314 |
<firstterm>wild card</firstterm></link>, |
| 315 |
in <link linkend="globbingref">globbing</link></para></listitem> |
| 316 |
<listitem><para>In a |
| 317 |
<link linkend="cstrinary"><firstterm>C</firstterm>-style |
| 318 |
Trinary operator</link></para></listitem> |
| 319 |
|
| 320 |
</itemizedlist></para> |
| 321 |
<!-- ********************** --> |
| 322 |
|
| 323 |
|
| 324 |
<para><command>// </command> |
| 325 |
<link linkend="doubleslashref">Double forward slash</link>, |
| 326 |
behavior of <link |
| 327 |
linkend="cdref">cd</link> command toward</para> |
| 328 |
|
| 329 |
<!-- ********************** --> |
| 330 |
|
| 331 |
<para><command>. </command> (dot / period) |
| 332 |
<itemizedlist> |
| 333 |
|
| 334 |
<listitem><para> |
| 335 |
<command>. </command> |
| 336 |
<link linkend="dotref">Load a file</link> (into a script), |
| 337 |
equivalent to <link |
| 338 |
linkend="sourceref">source</link> command |
| 339 |
</para></listitem> |
| 340 |
|
| 341 |
<listitem><para> |
| 342 |
<command>. </command> |
| 343 |
<link linkend="regexdot">Match single character</link>, |
| 344 |
in a <link linkend="regexref">Regular Expression</link> |
| 345 |
</para></listitem> |
| 346 |
|
| 347 |
<listitem><para> |
| 348 |
<command>. </command> |
| 349 |
<link linkend="dotdirectory">Current working |
| 350 |
directory</link> |
| 351 |
</para> |
| 352 |
<para> |
| 353 |
<command>./ </command> |
| 354 |
<link linkend="currentwdref">Current working |
| 355 |
directory</link> |
| 356 |
</para></listitem> |
| 357 |
|
| 358 |
<listitem><para> |
| 359 |
<command>.. </command> |
| 360 |
<link linkend="dotdirectory"><firstterm>Parent</firstterm> |
| 361 |
directory</link> |
| 362 |
</para></listitem> |
| 363 |
|
| 364 |
</itemizedlist> |
| 365 |
</para> |
| 366 |
|
| 367 |
<!-- ********************** --> |
| 368 |
|
| 369 |
<para><command>' ... '</command> |
| 370 |
(single quotes) |
| 371 |
<link linkend="snglquo"><firstterm>strong</firstterm> |
| 372 |
quoting</link></para> |
| 373 |
|
| 374 |
<para><command>" ... " </command> |
| 375 |
(double quotes) |
| 376 |
<link linkend="dblquo"><firstterm>weak</firstterm> |
| 377 |
quoting</link> |
| 378 |
<itemizedlist> |
| 379 |
<listitem><para><link |
| 380 |
linkend="quotingbsl"><firstterm>Double-quoting</firstterm> |
| 381 |
the <firstterm>backslash</firstterm> (<command>\</command>) |
| 382 |
character</link></para></listitem> |
| 383 |
</itemizedlist> |
| 384 |
</para> |
| 385 |
|
| 386 |
<para><command>,</command> |
| 387 |
<itemizedlist> |
| 388 |
<listitem><para> |
| 389 |
<link linkend="commaop">Comma operator</link> |
| 390 |
</para></listitem> |
| 391 |
<listitem> |
| 392 |
<para><command>,</command></para> |
| 393 |
<para><command>,,</command></para> |
| 394 |
<para><link linkend="casemodparamsub">Lowercase |
| 395 |
conversion</link> in <firstterm>parameter |
| 396 |
substitution</firstterm></para> |
| 397 |
</listitem> |
| 398 |
</itemizedlist> |
| 399 |
</para> |
| 400 |
|
| 401 |
|
| 402 |
<!-- ********************** --> |
| 403 |
<para><command>() </command> Parentheses |
| 404 |
<itemizedlist> |
| 405 |
|
| 406 |
<listitem><para><command>( ... ) </command> |
| 407 |
<link linkend="parensref">Command group</link>; |
| 408 |
starts a |
| 409 |
<link linkend="subshellsref">subshell</link></para></listitem> |
| 410 |
<listitem><para><command>( ... ) </command> |
| 411 |
<link linkend="parengrps">Enclose group</link> |
| 412 |
of <firstterm>Extended Regular |
| 413 |
Expressions</firstterm></para></listitem> |
| 414 |
<listitem> |
| 415 |
<para><command>>( ... )</command></para> |
| 416 |
<para><command><( ... ) </command> |
| 417 |
<link linkend="processsubref">Process substitution</link></para> |
| 418 |
</listitem> |
| 419 |
|
| 420 |
<listitem><para><command> ... ) </command> |
| 421 |
<link linkend="caseparen">Terminates test-condition</link> |
| 422 |
in <firstterm>case</firstterm> construct</para></listitem> |
| 423 |
<listitem><para><command>(( ... )) </command> |
| 424 |
<link linkend="dblparensref">Double parentheses</link>, |
| 425 |
in arithmetic expansion</para></listitem> |
| 426 |
</itemizedlist></para> |
| 427 |
<!-- ********************** --> |
| 428 |
|
| 429 |
<para><command>[ </command> <link linkend="leftbracket">Left bracket</link>, |
| 430 |
<firstterm>test</firstterm> construct</para> |
| 431 |
|
| 432 |
<para><command>[ ]</command>Brackets |
| 433 |
<itemizedlist> |
| 434 |
<listitem><para><link linkend="brackarray"><firstterm>Array</firstterm> |
| 435 |
element</link></para></listitem> |
| 436 |
<listitem><para><link linkend="bracketsref">Enclose character set |
| 437 |
to match</link> in a <firstterm>Regular |
| 438 |
Expression</firstterm></para></listitem> |
| 439 |
<listitem><para><link |
| 440 |
linkend="bracktest"><firstterm>Test</firstterm> construct</link></para> |
| 441 |
</listitem> |
| 442 |
</itemizedlist></para> |
| 443 |
|
| 444 |
<para><command>[[ ... ]]</command> |
| 445 |
<link linkend="dblbrackets">Double brackets</link>, |
| 446 |
extended <firstterm>test</firstterm> construct</para> |
| 447 |
|
| 448 |
<para><command>$ </command> |
| 449 |
<link linkend="dollarsignref"><firstterm>Anchor</firstterm></link>, |
| 450 |
in a <link linkend="regexref">Regular Expression</link></para> |
| 451 |
<para><command>$ </command> |
| 452 |
<link linkend="varsubn">Prefix to a variable name</link></para> |
| 453 |
<para><command>$( ... ) </command> |
| 454 |
<link linkend="commandsubref0">Command substitution</link>, |
| 455 |
setting a variable with output of a command, |
| 456 |
using parentheses notation</para> |
| 457 |
<para><command>` ... ` </command> |
| 458 |
<link linkend="backquotesref">Command substitution</link>, |
| 459 |
using <link linkend="backticksref">backquotes</link> |
| 460 |
notation</para> |
| 461 |
|
| 462 |
<para><command>$[ ... ]</command> |
| 463 |
<link linkend="bracketarith">Integer expansion</link> |
| 464 |
(deprecated)</para> |
| 465 |
|
| 466 |
|
| 467 |
<!-- ********************** --> |
| 468 |
<para><command>${ ... }</command> Variable manipulation / evaluation |
| 469 |
|
| 470 |
<itemizedlist> |
| 471 |
<listitem><para><command>${var}</command> |
| 472 |
<link linkend="pssub1">Value of a variable</link></para></listitem> |
| 473 |
|
| 474 |
<listitem><para><command>${#var}</command> |
| 475 |
<link linkend="psorex1">Length of a variable</link></para></listitem> |
| 476 |
|
| 477 |
<listitem> |
| 478 |
<para><command>${#@}</command></para> |
| 479 |
<para><command>${#*}</command> |
| 480 |
<link linkend="numposparam">Number of |
| 481 |
<firstterm>positional |
| 482 |
parameters</firstterm></link></para></listitem> |
| 483 |
|
| 484 |
<listitem> |
| 485 |
<para><command>${parameter?err_msg}</command> |
| 486 |
<link linkend="qerrmsg">Parameter-unset |
| 487 |
message</link></para></listitem> |
| 488 |
|
| 489 |
<listitem> |
| 490 |
<para><command>${parameter-default}</command></para> |
| 491 |
<para><command>${parameter:-default}</command></para> |
| 492 |
<para><command>${parameter=default}</command></para> |
| 493 |
<para><command>${parameter:=default}</command> |
| 494 |
<link linkend="defparam1">Set default |
| 495 |
parameter</link></para></listitem> |
| 496 |
|
| 497 |
<listitem> |
| 498 |
<para><command>${parameter+alt_value}</command></para> |
| 499 |
<para><command>${parameter:+alt_value}</command></para> |
| 500 |
<para><link linkend="paramaltv">Alternate value</link> |
| 501 |
of parameter, if set</para> |
| 502 |
</listitem> |
| 503 |
|
| 504 |
<listitem> |
| 505 |
<para><command>${!var}</command></para> |
| 506 |
<para><link linkend="ivr2">Indirect referencing of a variable</link>, |
| 507 |
new notation</para> |
| 508 |
</listitem> |
| 509 |
|
| 510 |
<listitem> |
| 511 |
<para><command>${!#}</command></para> |
| 512 |
<para><link linkend="lastargref">Final <firstterm>positional |
| 513 |
parameter</firstterm></link>. |
| 514 |
(This is an <firstterm>indirect reference</firstterm> to |
| 515 |
<link linkend="clacountref">$#</link>.)</para> |
| 516 |
</listitem> |
| 517 |
|
| 518 |
<listitem> |
| 519 |
<para><command>${!varprefix*}</command></para> |
| 520 |
<para><command>${!varprefix@}</command></para> |
| 521 |
<para><link linkend="varprefixm">Match |
| 522 |
<emphasis>names</emphasis></link> of all previously declared |
| 523 |
variables beginning with <varname>varprefix</varname></para> |
| 524 |
</listitem> |
| 525 |
|
| 526 |
<listitem> |
| 527 |
<para><command>${string:position}</command></para> |
| 528 |
<para><command>${string:position:length}</command> |
| 529 |
<link linkend="substrextr01">Substring |
| 530 |
extraction</link></para></listitem> |
| 531 |
|
| 532 |
<listitem> |
| 533 |
<para><command>${var#Pattern}</command></para> |
| 534 |
<para><command>${var##Pattern}</command> |
| 535 |
<link linkend="psorex2">Substring |
| 536 |
removal</link></para></listitem> |
| 537 |
|
| 538 |
<listitem> |
| 539 |
<para><command>${var%Pattern}</command></para> |
| 540 |
<para><command>${var%%Pattern}</command> |
| 541 |
<link linkend="pctpatref">Substring |
| 542 |
removal</link></para></listitem> |
| 543 |
|
| 544 |
<listitem> |
| 545 |
<para><command>${string/substring/replacement}</command></para> |
| 546 |
<para><command>${string//substring/replacement}</command></para> |
| 547 |
<para><command>${string/#substring/replacement}</command></para> |
| 548 |
<para><command>${string/%substring/replacement}</command> |
| 549 |
<link linkend="substrrepl00">Substring |
| 550 |
replacement</link></para></listitem> |
| 551 |
|
| 552 |
</itemizedlist></para> |
| 553 |
<!-- ********************** --> |
| 554 |
|
| 555 |
<para><command>$' ... '</command> |
| 556 |
<link linkend="strq">String expansion</link>, |
| 557 |
using <firstterm>escaped</firstterm> characters.</para> |
| 558 |
|
| 559 |
<para><command>\ </command> |
| 560 |
<link linkend="escp">Escape</link> the character following |
| 561 |
<itemizedlist> |
| 562 |
<listitem><para><command>\< ... \> </command> |
| 563 |
<link linkend="anglebrac">Angle brackets</link>, |
| 564 |
<firstterm>escaped</firstterm>, |
| 565 |
word boundary in a <link linkend="regexref">Regular |
| 566 |
Expression</link></para></listitem> |
| 567 |
<listitem><para><command>\{ N \}</command> |
| 568 |
<link linkend="escpcb"><quote>Curly</quote> brackets</link>, |
| 569 |
<firstterm>escaped</firstterm>, |
| 570 |
number of character sets to match in an <link |
| 571 |
linkend="extregex">Extended RE</link></para></listitem> |
| 572 |
<listitem><para><command>\; </command> |
| 573 |
<link linkend="findref0"><firstterm>Semicolon</firstterm></link>, |
| 574 |
<firstterm>escaped</firstterm>, |
| 575 |
terminates a <link linkend="findref">find</link> |
| 576 |
command</para></listitem> |
| 577 |
<listitem><para><command>\$$ </command> <link linkend="ivrref">Indirect |
| 578 |
reverencing of a variable</link>, old-style notation</para></listitem> |
| 579 |
<listitem><para><link linkend="escnewline">Escaping |
| 580 |
a <firstterm>newline</firstterm></link>, |
| 581 |
to write a multi-line command</para></listitem> |
| 582 |
</itemizedlist></para> |
| 583 |
|
| 584 |
<!-- ********************** --> |
| 585 |
<para><command>& </command> |
| 586 |
<itemizedlist> |
| 587 |
|
| 588 |
<listitem><para> |
| 589 |
<command>&> </command> |
| 590 |
<link linkend="redirouterror">Redirect |
| 591 |
<emphasis>both</emphasis> <filename>stdout</filename> |
| 592 |
and <filename>stderr</filename></link> of a command to a |
| 593 |
file</para></listitem> |
| 594 |
|
| 595 |
<listitem><para> |
| 596 |
<command>>&j </command> |
| 597 |
<link linkend="ioredirectionref1">Redirect |
| 598 |
<filename>stdout</filename></link> to |
| 599 |
<firstterm>file descriptor</firstterm> |
| 600 |
<firstterm>j</firstterm></para> |
| 601 |
<para> |
| 602 |
<command>>&2 </command> |
| 603 |
<link linkend="redirouterror2">Redirect |
| 604 |
<filename>stdout</filename></link> of a command to |
| 605 |
<filename>stderr</filename></para></listitem> |
| 606 |
|
| 607 |
<listitem><para> |
| 608 |
<command>i>&j </command> |
| 609 |
<link linkend="ioredirectionref1">Redirect |
| 610 |
<firstterm>file descriptor</firstterm></link> |
| 611 |
<firstterm>i</firstterm> to |
| 612 |
<firstterm>file descriptor</firstterm> |
| 613 |
<firstterm>j</firstterm></para> |
| 614 |
<para> |
| 615 |
<command>2>&1 </command> |
| 616 |
<link linkend="ioredirectionref1">Redirect |
| 617 |
<filename>stderr</filename></link> to |
| 618 |
<filename>stdout</filename></para></listitem> |
| 619 |
|
| 620 |
<listitem><para><link linkend="cfd">Closing <firstterm>file |
| 621 |
descriptors</firstterm></link></para> |
| 622 |
|
| 623 |
<para><command>n<&-</command> |
| 624 |
Close input file descriptor |
| 625 |
<firstterm>n</firstterm></para> |
| 626 |
<para><command>0<&-</command>, |
| 627 |
<command><&-</command> |
| 628 |
Close <filename>stdin</filename></para> |
| 629 |
<para><command>n>&-</command> |
| 630 |
Close output file descriptor |
| 631 |
<firstterm>n</firstterm></para> |
| 632 |
<para><command>1>&-</command>, |
| 633 |
<command>>&-</command> |
| 634 |
Close <filename>stdout</filename></para></listitem> |
| 635 |
|
| 636 |
|
| 637 |
<listitem><para> |
| 638 |
<command>&& </command> |
| 639 |
<link linkend="logicaland">Logical AND |
| 640 |
test operator</link></para></listitem> |
| 641 |
|
| 642 |
<listitem><para> |
| 643 |
<command>Command &</command> |
| 644 |
<link linkend="bgjob">Run job in |
| 645 |
<firstterm>background</firstterm></link></para></listitem> |
| 646 |
|
| 647 |
</itemizedlist></para> |
| 648 |
<!-- ********************** --> |
| 649 |
|
| 650 |
|
| 651 |
|
| 652 |
<para><command># </command> |
| 653 |
<link linkend="hashmarkref">Hashmark</link>, |
| 654 |
special symbol beginning a script |
| 655 |
<firstterm>comment</firstterm></para> |
| 656 |
|
| 657 |
<para><command>#!</command> |
| 658 |
<link linkend="shabangref">Sha-bang</link>, |
| 659 |
special string starting a |
| 660 |
<link linkend="whatsascript">shell script</link></para> |
| 661 |
|
| 662 |
<!-- ********************** --> |
| 663 |
<para><command>* </command> Asterisk |
| 664 |
<itemizedlist> |
| 665 |
|
| 666 |
<listitem><para> |
| 667 |
<link linkend="asteriskref"><firstterm>Wild |
| 668 |
card</firstterm></link>, |
| 669 |
in <link linkend="globbingref">globbing</link> |
| 670 |
</para></listitem> |
| 671 |
|
| 672 |
<listitem><para> |
| 673 |
<link linkend="asteriskref2">Any number of characters</link> |
| 674 |
in a <link linkend="regexref">Regular Expression</link> |
| 675 |
</para></listitem> |
| 676 |
|
| 677 |
<listitem><para> |
| 678 |
<command> ** </command> |
| 679 |
<link linkend="exponentiationref">Exponentiation</link>, |
| 680 |
arithmetic operator |
| 681 |
</para></listitem> |
| 682 |
|
| 683 |
<listitem><para> |
| 684 |
<command> ** </command> |
| 685 |
Extended <firstterm>globbing</firstterm> |
| 686 |
<link linkend="globstarref">file-match operator</link> |
| 687 |
</para></listitem> |
| 688 |
|
| 689 |
</itemizedlist> |
| 690 |
</para> |
| 691 |
<!-- ********************** --> |
| 692 |
<para><command>% </command> Percent sign |
| 693 |
<itemizedlist> |
| 694 |
|
| 695 |
<listitem><para> |
| 696 |
<link linkend="moduloref">Modulo</link>, division-remainder |
| 697 |
arithmetic operation |
| 698 |
</para></listitem> |
| 699 |
|
| 700 |
<listitem><para> |
| 701 |
<link linkend="pctpatref">Substring removal</link> |
| 702 |
(pattern matching) operator</para></listitem> |
| 703 |
|
| 704 |
</itemizedlist> |
| 705 |
</para> |
| 706 |
<!-- ********************** --> |
| 707 |
|
| 708 |
<para><command>+ </command> Plus sign |
| 709 |
<itemizedlist> |
| 710 |
<listitem><para><link linkend="plusref"><firstterm>Character |
| 711 |
match</firstterm></link>, in an <link |
| 712 |
linkend="extregex">extended Regular |
| 713 |
Expression</link></para></listitem> |
| 714 |
<listitem><para><link linkend="paramaltv">Prefix to |
| 715 |
<firstterm>alternate parameter</firstterm></link>, in |
| 716 |
<firstterm>parameter substitution</firstterm></para></listitem> |
| 717 |
<listitem><para><command> ++ </command> |
| 718 |
<link linkend="plusplusref"><firstterm>C-style</firstterm> |
| 719 |
variable increment</link>, within |
| 720 |
<link linkend="dblparensref">double |
| 721 |
parentheses</link></para></listitem> |
| 722 |
</itemizedlist></para> |
| 723 |
|
| 724 |
<para>* * *</para> |
| 725 |
|
| 726 |
<para><firstterm>Shell Variables</firstterm></para> |
| 727 |
|
| 728 |
<para><command>$_ </command> |
| 729 |
<link linkend="underscoreref">Last argument to previous |
| 730 |
command</link></para> |
| 731 |
<para><command>$- </command> |
| 732 |
<link linkend="flpref">Flags passed to script</link>, using <link |
| 733 |
linkend="setref">set</link></para> |
| 734 |
<para><command>$! </command> |
| 735 |
<link linkend="pidvarref"><firstterm>Process ID</firstterm> |
| 736 |
of last background job</link></para> |
| 737 |
<para><command>$? </command> |
| 738 |
<link linkend="exsref"><firstterm>Exit |
| 739 |
status</firstterm> of a command</link></para> |
| 740 |
<para><command>$@ </command> |
| 741 |
All the <firstterm>positional parameters</firstterm>, <link |
| 742 |
linkend="appref2">as <emphasis>separate</emphasis> |
| 743 |
words</link></para> |
| 744 |
<para><command> $* </command> |
| 745 |
All the <firstterm>positional parameters</firstterm>, <link |
| 746 |
linkend="appref">as a <emphasis>single</emphasis> |
| 747 |
word</link></para> |
| 748 |
<para><command>$$ </command> |
| 749 |
<link linkend="processidref">Process ID</link> of the |
| 750 |
script</para> |
| 751 |
<para><command>$# </command> |
| 752 |
<link linkend="clacountref">Number of arguments passed</link> to a |
| 753 |
<link linkend="functionref">function</link>, or to the script |
| 754 |
itself</para> |
| 755 |
<para><command>$0 </command> |
| 756 |
<link linkend="scrnameparam">Filename of the script</link></para> |
| 757 |
<para><command>$1 </command> |
| 758 |
<link linkend="posparamref1">First argument passed to script</link></para> |
| 759 |
<para><command>$9 </command> |
| 760 |
<link linkend="posparamref1">Ninth argument passed to script</link></para> |
| 761 |
<para><link linkend="specshvartab"><command>Table</command></link> |
| 762 |
of <firstterm>shell variables</firstterm></para> |
| 763 |
|
| 764 |
<!-- End Characters and symbols --> |
| 765 |
|
| 766 |
<para>* * * * * *</para> |
| 767 |
|
| 768 |
<para><command>-a </command> |
| 769 |
<link linkend="compoundand">Logical AND</link> |
| 770 |
compound comparison test</para> |
| 771 |
<para>Address database, <link linkend="ex30">script |
| 772 |
example</link></para> |
| 773 |
|
| 774 |
<para><firstterm>Advanced Bash Scripting Guide</firstterm>, |
| 775 |
<link linkend="where_tarball">where to download</link></para> |
| 776 |
|
| 777 |
<para><link linkend="aliasref">Alias</link> |
| 778 |
<itemizedlist> |
| 779 |
<listitem><para><link linkend="unaliasref">Removing an |
| 780 |
<firstterm>alias</firstterm></link>, using |
| 781 |
<firstterm>unalias</firstterm></para></listitem> |
| 782 |
</itemizedlist></para> |
| 783 |
|
| 784 |
<para><link linkend="agram2">Anagramming</link></para> |
| 785 |
|
| 786 |
<para><link linkend="lcons1"><firstterm>And</firstterm> list</link> |
| 787 |
<itemizedlist> |
| 788 |
<listitem><para> |
| 789 |
<link linkend="anddefault">To supply default command-line |
| 790 |
argument</link></para></listitem> |
| 791 |
</itemizedlist></para> |
| 792 |
|
| 793 |
<para><link linkend="logops1"><firstterm>And</firstterm> logical |
| 794 |
operator</link> <command>&&</command></para> |
| 795 |
|
| 796 |
<para><link linkend="anglebrac">Angle brackets</link>, |
| 797 |
<firstterm>escaped</firstterm>, |
| 798 |
<command>\< . . . \> </command> |
| 799 |
word boundary in a <link linkend="regexref">Regular |
| 800 |
Expression</link></para> |
| 801 |
<para><link linkend="anonheredoc0">Anonymous |
| 802 |
<firstterm>here document</firstterm></link>, using |
| 803 |
<command>:</command></para> |
| 804 |
|
| 805 |
<!-- ********************** --> |
| 806 |
<para><link linkend="faarchiving1">Archiving</link> |
| 807 |
<itemizedlist> |
| 808 |
<listitem><para><link linkend="rpmref">rpm</link></para></listitem> |
| 809 |
<listitem><para><link linkend="tarref">tar</link></para></listitem> |
| 810 |
</itemizedlist></para> |
| 811 |
<!-- ********************** --> |
| 812 |
<para><link linkend="arithexpref">Arithmetic expansion</link> |
| 813 |
<itemizedlist> |
| 814 |
<listitem><para><link linkend="arxs"> |
| 815 |
<firstterm>exit status</firstterm> of</link></para></listitem> |
| 816 |
<listitem><para><link linkend="arithexpvar1"> |
| 817 |
variations of</link></para></listitem> |
| 818 |
</itemizedlist></para> |
| 819 |
<!-- ********************** --> |
| 820 |
|
| 821 |
<para><link linkend="arops1">Arithmetic operators</link> |
| 822 |
<itemizedlist> |
| 823 |
<listitem><para><link linkend="arithopscomb"> |
| 824 |
combination operators</link>, <firstterm>C</firstterm>-style</para> |
| 825 |
<para><command> += </command> |
| 826 |
<command> -= </command> |
| 827 |
<command> *= </command> |
| 828 |
<command> /= </command> |
| 829 |
<command> %= </command> |
| 830 |
</para> |
| 831 |
|
| 832 |
<note><para><link linkend="pluseqstr">In certain contexts</link>, |
| 833 |
<command>+=</command> can also function as a <firstterm>string |
| 834 |
concatenation</firstterm> operator.</para></note> |
| 835 |
|
| 836 |
</listitem> |
| 837 |
</itemizedlist></para> |
| 838 |
|
| 839 |
|
| 840 |
<para><link linkend="arrayref">Arrays</link></para> |
| 841 |
<itemizedlist> |
| 842 |
<listitem><para><link linkend="assocarr">Associative arrays</link> |
| 843 |
</para> |
| 844 |
<para><link linkend="assocarrtst">more efficient</link> |
| 845 |
than conventional arrays</para> |
| 846 |
</listitem> |
| 847 |
<listitem><para><link linkend="arrayref">Bracket notation</link> |
| 848 |
</para></listitem> |
| 849 |
<listitem><para><link linkend="arrayappend0">Concatenating</link>, |
| 850 |
<firstterm>example script</firstterm></para></listitem> |
| 851 |
<listitem><para><link linkend="copyarray0">Copying</link> |
| 852 |
</para></listitem> |
| 853 |
<listitem><para><link |
| 854 |
linkend="arraydeclare">Declaring</link></para> |
| 855 |
<para><varname>declare -a |
| 856 |
array_name</varname></para></listitem> |
| 857 |
|
| 858 |
<listitem><para><link linkend="arrayindir">Embedded |
| 859 |
arrays</link></para></listitem> |
| 860 |
<listitem><para><link linkend="emptyarray0">Empty |
| 861 |
arrays, empty elements</link>, <firstterm>example |
| 862 |
script</firstterm></para></listitem> |
| 863 |
<listitem><para><link linkend="arrayindir">Indirect references</link> |
| 864 |
</para></listitem> |
| 865 |
|
| 866 |
<listitem> |
| 867 |
<para><link linkend="arrayinit0">Initialization</link></para> |
| 868 |
<para><varname>array=( element1 element2 ... elementN)</varname></para> |
| 869 |
<para><link linkend="arrayassign0"><firstterm>Example |
| 870 |
script</firstterm></link></para> |
| 871 |
<para>Using <link linkend="arrayinitcs">command |
| 872 |
substitution</link></para> |
| 873 |
</listitem> |
| 874 |
|
| 875 |
<listitem><para><link linkend="arrayinitcs">Loading a |
| 876 |
file</link> into an array</para></listitem> |
| 877 |
<listitem><para><link |
| 878 |
linkend="arraymultidim">Multidimensional</link>, |
| 879 |
simulating</para></listitem> |
| 880 |
<listitem><para><link linkend="arraynest">Nesting and |
| 881 |
embedding</link></para></listitem> |
| 882 |
<listitem><para><link linkend="arraynotation">Notation |
| 883 |
and usage</link></para></listitem> |
| 884 |
<listitem><para><link |
| 885 |
linkend="arraynumelements">Number of elements in</link></para> |
| 886 |
<para><varname>${#array_name[@]}</varname></para> |
| 887 |
<para><varname>${#array_name[*]}</varname></para></listitem> |
| 888 |
<listitem><para><link |
| 889 |
linkend="arraysyntax">Operations</link></para></listitem> |
| 890 |
<listitem><para><link linkend="passarray">Passing |
| 891 |
an <firstterm>array</firstterm></link> to a |
| 892 |
function</para></listitem> |
| 893 |
<listitem><para>As <link linkend="retarray"> |
| 894 |
<firstterm>return value</firstterm> from |
| 895 |
a function</link></para></listitem> |
| 896 |
|
| 897 |
<listitem><para>Special properties, |
| 898 |
<link linkend="arrayspecialprops">example |
| 899 |
script</link></para></listitem> |
| 900 |
<listitem><para>String operations, |
| 901 |
<link linkend="arraystringops">example |
| 902 |
script</link></para></listitem> |
| 903 |
<listitem><para><link |
| 904 |
linkend="arrayunset"><firstterm>unset</firstterm> deletes array |
| 905 |
elements</link></para></listitem> |
| 906 |
</itemizedlist> |
| 907 |
|
| 908 |
<para><link linkend="readarrow">Arrow keys</link>, detecting</para> |
| 909 |
|
| 910 |
<para>ASCII |
| 911 |
<itemizedlist> |
| 912 |
<listitem><para><link |
| 913 |
linkend="asciidef">Definition</link></para></listitem> |
| 914 |
<listitem><para><link linkend="asciitable"> |
| 915 |
Scripts for generating ASCII table</link></para></listitem> |
| 916 |
</itemizedlist> |
| 917 |
</para> |
| 918 |
|
| 919 |
<!-- ********************** --> |
| 920 |
<para><link linkend="awk">awk</link> field-oriented text |
| 921 |
processing language |
| 922 |
<itemizedlist> |
| 923 |
<listitem><para><link linkend="awkrandomref"> |
| 924 |
<varname>rand()</varname></link>, |
| 925 |
random function</para></listitem> |
| 926 |
<listitem><para><link linkend="awkstringmanip2">String |
| 927 |
manipulation</link></para></listitem> |
| 928 |
<listitem><para><link linkend="exportawk">Using |
| 929 |
<firstterm>export</firstterm></link> to pass a variable to an |
| 930 |
embedded <firstterm>awk</firstterm> script</para></listitem> |
| 931 |
</itemizedlist></para> |
| 932 |
<!-- ********************** --> |
| 933 |
|
| 934 |
<para>* * *</para> |
| 935 |
|
| 936 |
<para>Backlight, <link linkend="backlight">setting the |
| 937 |
brightness</link></para> |
| 938 |
<para><link linkend="backticksref">Backquotes</link>, |
| 939 |
used in <link linkend="backquotesref">command |
| 940 |
substitution</link></para> |
| 941 |
<para><link linkend="base0">Base conversion</link>, |
| 942 |
<firstterm>example script</firstterm></para> |
| 943 |
|
| 944 |
<!-- ********************** --> |
| 945 |
<para><link linkend="bashdef">Bash</link> |
| 946 |
<itemizedlist> |
| 947 |
|
| 948 |
<listitem><para><link linkend="bash3gotcha">Bad scripting |
| 949 |
practices</link></para></listitem> |
| 950 |
<listitem><para><link linkend="basicsrev0">Basics reviewed</link>, |
| 951 |
<firstterm>script example</firstterm></para></listitem> |
| 952 |
<listitem> |
| 953 |
<para><link linkend="clopts">Command-line |
| 954 |
options</link></para> |
| 955 |
<para><link |
| 956 |
linkend="optionstable"><command>Table</command></link></para> |
| 957 |
</listitem> |
| 958 |
<listitem><para> <link linkend="bashcompat">Features that classic |
| 959 |
<firstterm>Bourne</firstterm> shell lacks</link></para></listitem> |
| 960 |
<listitem> |
| 961 |
<para><link |
| 962 |
linkend="internalvariables">Internal variables</link></para> |
| 963 |
</listitem> |
| 964 |
<listitem><para><link linkend="bash2ref"> |
| 965 |
Version 2</link></para></listitem> |
| 966 |
<listitem><para><link linkend="bash3ref"> |
| 967 |
Version 3</link></para></listitem> |
| 968 |
<listitem> |
| 969 |
<para><link linkend="bash4ref">Version 4</link></para> |
| 970 |
<para><link linkend="bash41">Version 4.1</link></para> |
| 971 |
<para><link linkend="bash42">Version 4.2</link></para> |
| 972 |
</listitem> |
| 973 |
|
| 974 |
</itemizedlist></para> |
| 975 |
<!-- ********************** --> |
| 976 |
|
| 977 |
|
| 978 |
<para><link linkend="sample-bashrc">.bashrc</link></para> |
| 979 |
<para><link |
| 980 |
linkend="bashsubshellref"><varname>$BASH_SUBSHELL</varname></link></para> |
| 981 |
<para><link linkend="basiccommands1">Basic commands</link>, external</para> |
| 982 |
<para><link linkend="dosbatch1">Batch files</link>, |
| 983 |
<firstterm>DOS</firstterm></para> |
| 984 |
|
| 985 |
<para><link linkend="batchprocref">Batch processing</link></para> |
| 986 |
|
| 987 |
<para><link linkend="bcref">bc</link>, calculator utility |
| 988 |
<itemizedlist> |
| 989 |
<listitem><para><link linkend="bcheredoc">In a <firstterm>here |
| 990 |
document</firstterm></link></para></listitem> |
| 991 |
<listitem><para><link linkend="bctemplate">Template</link> |
| 992 |
for calculating a script variable</para></listitem> |
| 993 |
</itemizedlist></para> |
| 994 |
|
| 995 |
<para><link linkend="biblio">Bibliography</link></para> |
| 996 |
<para><link linkend="bisonref">Bison</link> utility</para> |
| 997 |
|
| 998 |
<para><link linkend="bitwsops1">Bitwise operators</link> |
| 999 |
<itemizedlist> |
| 1000 |
<listitem><para><link linkend="base64">Example script</link> |
| 1001 |
</para></listitem> |
| 1002 |
</itemizedlist> |
| 1003 |
</para> |
| 1004 |
|
| 1005 |
<para><link linkend="blockdevref">Block devices</link> |
| 1006 |
<itemizedlist> |
| 1007 |
<listitem><para><link linkend="blockdevtest">testing |
| 1008 |
for</link></para></listitem> |
| 1009 |
</itemizedlist> |
| 1010 |
</para> |
| 1011 |
|
| 1012 |
<para><link linkend="codeblockref">Blocks of code</link> |
| 1013 |
<itemizedlist> |
| 1014 |
<listitem> |
| 1015 |
<para><link linkend="nododone">Iterating / looping</link></para> |
| 1016 |
</listitem> |
| 1017 |
<listitem> |
| 1018 |
<para><link |
| 1019 |
linkend="blockio">Redirection</link></para> |
| 1020 |
<para><firstterm>Script example</firstterm>: |
| 1021 |
<link linkend="blockio2">Redirecting output of a a code |
| 1022 |
block</link></para></listitem> |
| 1023 |
</itemizedlist></para> |
| 1024 |
|
| 1025 |
<para><link linkend="bfs">Bootable flash drives</link>, creating</para> |
| 1026 |
|
| 1027 |
<!-- ********************** --> |
| 1028 |
<para><link linkend="braceexpref">Brace expansion</link> |
| 1029 |
<itemizedlist> |
| 1030 |
<listitem><para><link |
| 1031 |
linkend="braceexpref33">Extended</link>, |
| 1032 |
<replaceable>{a..z}</replaceable></para></listitem> |
| 1033 |
<listitem><para><link |
| 1034 |
linkend="braceexpref3">Parameterizing</link> |
| 1035 |
</para></listitem> |
| 1036 |
<listitem><para>With <link |
| 1037 |
linkend="braceexpref4">increment and |
| 1038 |
zero-padding</link> (new feature in Bash, <link linkend="bash4ref">version |
| 1039 |
4</link>)</para></listitem> |
| 1040 |
</itemizedlist></para> |
| 1041 |
<!-- ********************** --> |
| 1042 |
|
| 1043 |
<para>Brackets, <command>[ ]</command> |
| 1044 |
<itemizedlist> |
| 1045 |
<listitem><para><link linkend="brackarray"><firstterm>Array</firstterm> |
| 1046 |
element</link></para></listitem> |
| 1047 |
<listitem><para><link linkend="bracketsref">Enclose character set |
| 1048 |
to match</link> in a <firstterm>Regular |
| 1049 |
Expression</firstterm></para></listitem> |
| 1050 |
<listitem><para><link |
| 1051 |
linkend="bracktest"><firstterm>Test</firstterm> construct</link></para> |
| 1052 |
</listitem> |
| 1053 |
</itemizedlist></para> |
| 1054 |
|
| 1055 |
<para>Brackets, <firstterm>curly</firstterm>, <command>{}</command>, |
| 1056 |
used in</para> |
| 1057 |
<itemizedlist> |
| 1058 |
<listitem><para><link linkend="codeblockref">Code |
| 1059 |
block</link></para></listitem> |
| 1060 |
<listitem><para><link linkend="curlybracketsref"> |
| 1061 |
<firstterm>find</firstterm></link></para></listitem> |
| 1062 |
<listitem><para><link linkend="escpcb"><firstterm>Extended Regular |
| 1063 |
Expressions</firstterm></link></para></listitem> |
| 1064 |
<listitem><para><link linkend="bracketnotation"><firstterm>Positional |
| 1065 |
parameters</firstterm></link></para></listitem> |
| 1066 |
<listitem><para><link |
| 1067 |
linkend="xargscurlyref"><firstterm>xargs</firstterm></link></para></listitem> |
| 1068 |
</itemizedlist> |
| 1069 |
|
| 1070 |
<!-- ********************** --> |
| 1071 |
|
| 1072 |
<para><link linkend="brkcont1">break</link> |
| 1073 |
<firstterm>loop</firstterm> control command |
| 1074 |
<itemizedlist> |
| 1075 |
<listitem><para><link linkend="breakparam">Parameter</link> |
| 1076 |
(optional)</para></listitem> |
| 1077 |
</itemizedlist></para> |
| 1078 |
|
| 1079 |
<para><link linkend="builtinref">Builtins</link> in |
| 1080 |
<firstterm>Bash</firstterm> |
| 1081 |
<itemizedlist> |
| 1082 |
<listitem><para><link linkend="bltinfrk">Do not fork a subprocess</link> |
| 1083 |
</para></listitem> |
| 1084 |
</itemizedlist></para> |
| 1085 |
|
| 1086 |
<para>* * *</para> |
| 1087 |
|
| 1088 |
<para><link linkend="caseesac1"><firstterm>case</firstterm> |
| 1089 |
construct</link> |
| 1090 |
<itemizedlist> |
| 1091 |
<listitem><para><link linkend="casecl">Command-line parameters</link>, |
| 1092 |
handling</para></listitem> |
| 1093 |
<listitem><para><link linkend="csglob">Globbing</link>, |
| 1094 |
filtering strings with</para></listitem> |
| 1095 |
</itemizedlist></para> |
| 1096 |
|
| 1097 |
<para><link linkend="catref">cat</link>, |
| 1098 |
con<firstterm>cat</firstterm>entate file(s) |
| 1099 |
<itemizedlist> |
| 1100 |
<listitem><para><link linkend="catabuse">Abuse of</link></para></listitem> |
| 1101 |
<listitem><para><link linkend="catscriptref"><firstterm>cat</firstterm> |
| 1102 |
scripts</link></para></listitem> |
| 1103 |
<listitem><para><link linkend="catlesseff">Less efficient than |
| 1104 |
redirecting <filename>stdin</filename></link></para></listitem> |
| 1105 |
<listitem><para><link linkend="readpiperef">Piping the output |
| 1106 |
of</link>, to a <link linkend="readref">read</link></para></listitem> |
| 1107 |
<listitem><para><link linkend="catuses">Uses of</link></para></listitem> |
| 1108 |
</itemizedlist></para> |
| 1109 |
|
| 1110 |
|
| 1111 |
<para><link linkend="chardevref">Character devices</link> |
| 1112 |
<itemizedlist> |
| 1113 |
<listitem><para><link linkend="chardevtest">testing |
| 1114 |
for</link></para></listitem> |
| 1115 |
</itemizedlist> |
| 1116 |
</para> |
| 1117 |
|
| 1118 |
<para><link linkend="checksumref">Checksum</link></para> |
| 1119 |
<para><link linkend="childref">Child processes</link></para> |
| 1120 |
<para><link linkend="nullref">Colon</link>, <command>: </command>, |
| 1121 |
equivalent to the <link linkend="trueref">true</link> Bash |
| 1122 |
builtin</para> |
| 1123 |
|
| 1124 |
<para><link linkend="colorizingref">Colorizing scripts</link> |
| 1125 |
<itemizedlist> |
| 1126 |
<listitem><para>Cycling through the background colors, <link |
| 1127 |
linkend="showallc">example script</link></para></listitem> |
| 1128 |
<listitem><para><link |
| 1129 |
linkend="coloriztable"><command>Table</command></link> of |
| 1130 |
color escape sequences</para></listitem> |
| 1131 |
<listitem><para><link |
| 1132 |
linkend="coloriztempl">Template</link>, |
| 1133 |
colored text on colored background</para></listitem> |
| 1134 |
</itemizedlist></para> |
| 1135 |
|
| 1136 |
<para><link linkend="commaop">Comma operator</link>, |
| 1137 |
linking commands or operations</para> |
| 1138 |
|
| 1139 |
<para><link linkend="bash-options">Command-line options</link></para> |
| 1140 |
|
| 1141 |
<para><link linkend="cnfh">command_not_found_handle ()</link> |
| 1142 |
<firstterm>builtin</firstterm> error-handling function |
| 1143 |
(<link linkend="bash4ref">version 4+</link> of Bash)</para> |
| 1144 |
|
| 1145 |
<para><link linkend="commandsubref">Command substitution</link> |
| 1146 |
<itemizedlist> |
| 1147 |
<listitem> |
| 1148 |
<para> |
| 1149 |
<link linkend="csparens"><command>$( ... )</command></link>, |
| 1150 |
preferred notation</para> |
| 1151 |
</listitem> |
| 1152 |
<listitem><para><link |
| 1153 |
linkend="backquotesref"><firstterm>Backquotes</firstterm></link></para></listitem> |
| 1154 |
<listitem><para><link linkend="cstoolset">Extending the |
| 1155 |
<firstterm>Bash</firstterm> toolset</link></para></listitem> |
| 1156 |
<listitem><para><link linkend="cssubsh">Invokes a |
| 1157 |
<firstterm>subshell</firstterm></link></para></listitem> |
| 1158 |
<listitem><para><link linkend="csnest">Nesting</link></para></listitem> |
| 1159 |
<listitem><para><link linkend="cstrnl">Removes trailing newlines</link> |
| 1160 |
</para></listitem> |
| 1161 |
<listitem><para><link linkend="csvl">Setting variable from loop output</link> |
| 1162 |
</para></listitem> |
| 1163 |
<listitem><para><link linkend="csws">Word |
| 1164 |
splitting</link></para></listitem> |
| 1165 |
</itemizedlist></para> |
| 1166 |
|
| 1167 |
<para><link linkend="commenth">Comment headers</link>, |
| 1168 |
special purpose</para> |
| 1169 |
|
| 1170 |
<para>Commenting out blocks of code |
| 1171 |
<itemizedlist> |
| 1172 |
<listitem><para>Using an <link |
| 1173 |
linkend="cblock1"><firstterm>anonymous</firstterm> here |
| 1174 |
document</link></para></listitem> |
| 1175 |
<listitem><para>Using an <link linkend="comoutbl"> |
| 1176 |
<firstterm>if-then</firstterm> construct</link></para></listitem> |
| 1177 |
</itemizedlist></para> |
| 1178 |
|
| 1179 |
|
| 1180 |
|
| 1181 |
<para><link linkend="communications">Communications and |
| 1182 |
hosts</link></para> |
| 1183 |
<para><link linkend="ccomparison1">Compound comparison</link> |
| 1184 |
operators</para> |
| 1185 |
|
| 1186 |
<!-- ************************************************************ --> |
| 1187 |
<para><link linkend="facompression1">Compression utilities</link> |
| 1188 |
<itemizedlist> |
| 1189 |
<listitem><para><link linkend="bzipref">bzip2</link></para></listitem> |
| 1190 |
<listitem><para><link |
| 1191 |
linkend="compressref">compress</link></para></listitem> |
| 1192 |
<listitem><para><link linkend="gzipref">gzip</link></para></listitem> |
| 1193 |
<listitem><para><link linkend="zipref">zip</link></para></listitem> |
| 1194 |
</itemizedlist></para> |
| 1195 |
<!-- ************************************************************ --> |
| 1196 |
<para><link linkend="brkcont1">continue</link> loop control command</para> |
| 1197 |
|
| 1198 |
<!-- ***************************************************************** --> |
| 1199 |
<para><link linkend="controlcharref">Control characters</link> |
| 1200 |
<itemizedlist> |
| 1201 |
<listitem><para><link linkend="ctlcref">Control-C</link>, |
| 1202 |
<firstterm>break</firstterm></para></listitem> |
| 1203 |
<listitem><para><link linkend="ctldref">Control-D</link>, |
| 1204 |
terminate / log out / erase</para></listitem> |
| 1205 |
<listitem><para><link linkend="ctlgref">Control-G</link>, |
| 1206 |
<userinput>BEL</userinput> |
| 1207 |
(<firstterm>beep</firstterm>)</para></listitem> |
| 1208 |
<listitem><para><link linkend="ctlhref">Control-H</link>, |
| 1209 |
<firstterm>rubout</firstterm></para></listitem> |
| 1210 |
<listitem><para><link linkend="ctljref">Control-J</link>, |
| 1211 |
<firstterm>newline</firstterm></para></listitem> |
| 1212 |
<listitem><para><link linkend="ctlmref">Control-M</link>, |
| 1213 |
carriage return</para></listitem> |
| 1214 |
</itemizedlist></para> |
| 1215 |
<!-- ***************************************************************** --> |
| 1216 |
|
| 1217 |
<para><link linkend="coprocref">Coprocesses</link></para> |
| 1218 |
<para><link linkend="cronref">cron</link>, scheduling |
| 1219 |
<firstterm>daemon</firstterm></para> |
| 1220 |
<para><link linkend="cstyle"><firstterm>C</firstterm>-style syntax |
| 1221 |
</link>, for handling variables</para> |
| 1222 |
|
| 1223 |
<para><link linkend="cwsolver">Crossword puzzle solver</link></para> |
| 1224 |
<para><link linkend="gronsfeld">Cryptography</link></para> |
| 1225 |
|
| 1226 |
<para>Curly brackets {} |
| 1227 |
<itemizedlist> |
| 1228 |
<listitem><para><link linkend="curlybracketsref">in |
| 1229 |
<firstterm>find</firstterm> command</link></para></listitem> |
| 1230 |
<listitem><para><link linkend="escpcb">in an |
| 1231 |
<firstterm>Extended Regular |
| 1232 |
Expression</firstterm></link></para></listitem> |
| 1233 |
<listitem><para><link linkend="xargscurlyref">in |
| 1234 |
<firstterm>xargs</firstterm></link></para></listitem> |
| 1235 |
</itemizedlist></para> |
| 1236 |
|
| 1237 |
<para>* * *</para> |
| 1238 |
|
| 1239 |
<para><link linkend="daemonref">Daemons</link>, in UNIX-type OS</para> |
| 1240 |
|
| 1241 |
<para><link linkend="dateref">date</link></para> |
| 1242 |
<para><link linkend="dcref">dc</link>, calculator utility</para> |
| 1243 |
|
| 1244 |
<para><link linkend="ddref">dd</link>, <firstterm>data |
| 1245 |
duplicator</firstterm> command |
| 1246 |
<itemizedlist> |
| 1247 |
|
| 1248 |
<listitem><para><link |
| 1249 |
linkend="ddconversions">Conversions</link></para></listitem> |
| 1250 |
<listitem><para><link linkend="ddcopy">Copying raw data</link> |
| 1251 |
to/from devices</para></listitem> |
| 1252 |
<listitem><para><link |
| 1253 |
linkend="ddfdel">File deletion</link>, |
| 1254 |
<firstterm>secure</firstterm></para></listitem> |
| 1255 |
<listitem><para><link |
| 1256 |
linkend="ddkeystrokes">Keystrokes</link>, capturing</para></listitem> |
| 1257 |
<listitem><para><link |
| 1258 |
linkend="ddoptions">Options</link></para></listitem> |
| 1259 |
<listitem><para><link |
| 1260 |
linkend="ddrandom">Random access</link> on a data |
| 1261 |
stream</para></listitem> |
| 1262 |
<listitem><para><emphasis>Raspberry Pi</emphasis>, |
| 1263 |
<link linkend="rpsdcard01">script for preparing a bootable SD |
| 1264 |
card</link> |
| 1265 |
</para></listitem> |
| 1266 |
<listitem><para><link |
| 1267 |
linkend="ddswap">Swapfiles</link>, initializing</para></listitem> |
| 1268 |
<listitem><para><link linkend="ddlink">Thread on |
| 1269 |
<firstterm>www.linuxquestions.org</firstterm></link></para></listitem> |
| 1270 |
|
| 1271 |
</itemizedlist></para> |
| 1272 |
|
| 1273 |
<para><link linkend="debugging">Debugging scripts</link> |
| 1274 |
<itemizedlist> |
| 1275 |
<listitem><para><link |
| 1276 |
linkend="debugtools">Tools</link></para></listitem> |
| 1277 |
<listitem><para><link |
| 1278 |
linkend="debugtrap"><firstterm>Trapping</firstterm> at |
| 1279 |
exit</link></para></listitem> |
| 1280 |
<listitem><para><link |
| 1281 |
linkend="trapref1"><firstterm>Trapping</firstterm> |
| 1282 |
signals</link></para></listitem> |
| 1283 |
</itemizedlist></para> |
| 1284 |
|
| 1285 |
<para><link linkend="numconstants">Decimal number</link>, |
| 1286 |
Bash interprets numbers as</para> |
| 1287 |
|
| 1288 |
<para><link linkend="declare1ref">declare</link> builtin</para> |
| 1289 |
<itemizedlist> |
| 1290 |
<listitem> |
| 1291 |
<para><link linkend="declareopsref1">options</link></para> |
| 1292 |
<para><link linkend="declarecasemod">case-modification</link> |
| 1293 |
options (<link linkend="bash4ref">version 4+</link> of Bash) |
| 1294 |
</para></listitem> |
| 1295 |
</itemizedlist> |
| 1296 |
|
| 1297 |
<para><link linkend="defparam">Default parameters</link></para> |
| 1298 |
|
| 1299 |
<!-- ******************************************************************* --> |
| 1300 |
<para><link linkend="devprocref"><filename |
| 1301 |
class="directory">/dev</filename></link> directory |
| 1302 |
|
| 1303 |
<itemizedlist> |
| 1304 |
<listitem><para><link |
| 1305 |
linkend="devnullref"><filename>/dev/null</filename></link> |
| 1306 |
pseudo-device file</para></listitem> |
| 1307 |
|
| 1308 |
<listitem><para><link |
| 1309 |
linkend="urandomref"><filename>/dev/urandom</filename></link> |
| 1310 |
pseudo-device file, generating pseudorandom numbers |
| 1311 |
with</para></listitem> |
| 1312 |
|
| 1313 |
<listitem><para><link |
| 1314 |
linkend="zerosref1"><filename>/dev/zero</filename></link>, |
| 1315 |
pseudo-device file</para></listitem> |
| 1316 |
</itemizedlist></para> |
| 1317 |
<!-- ******************************************************************* --> |
| 1318 |
|
| 1319 |
|
| 1320 |
<para><link linkend="devfileref">Device file</link></para> |
| 1321 |
<para><link linkend="dialogref"><firstterm>dialog</firstterm></link>, |
| 1322 |
utility for generating <firstterm>dialog</firstterm> boxes in |
| 1323 |
a script</para> |
| 1324 |
<para><link linkend="dirstackref"><varname>$DIRSTACK</varname></link> |
| 1325 |
<firstterm>directory stack</firstterm></para> |
| 1326 |
<para><link linkend="disabledcommref">Disabled commands</link>, |
| 1327 |
in <firstterm>restricted shells</firstterm></para> |
| 1328 |
<para><link linkend="doinref">do</link> keyword, |
| 1329 |
begins execution of commands within a <link |
| 1330 |
linkend="loopref00">loop</link></para> |
| 1331 |
<para><link linkend="doinref">done</link> keyword, |
| 1332 |
terminates a loop</para> |
| 1333 |
<para><link linkend="dosbatch1"><firstterm>DOS</firstterm> batch |
| 1334 |
files</link>, converting to shell scripts</para> |
| 1335 |
<para><link linkend="dosunixequiv"><firstterm>DOS</firstterm> |
| 1336 |
commands</link>, UNIX equivalents of |
| 1337 |
(<command>table</command>)</para> |
| 1338 |
<para><link linkend="dotfilesref"><firstterm>dot files</firstterm></link>, |
| 1339 |
<quote>hidden</quote> setup and configuration files</para> |
| 1340 |
|
| 1341 |
<para><link linkend="dblbrackets">Double brackets</link> |
| 1342 |
<command>[[ ... ]]</command> <link linkend="ifthen">test</link> |
| 1343 |
construct</para> |
| 1344 |
<itemizedlist> |
| 1345 |
<listitem><para>and <link linkend="dblbraev">evaluation of |
| 1346 |
<firstterm>octal/hex</firstterm> constants</link></para></listitem> |
| 1347 |
</itemizedlist> |
| 1348 |
|
| 1349 |
<para><link linkend="dblparensref">Double parentheses</link> |
| 1350 |
<command>(( ... )) </command> arithmetic expansion/evaluation |
| 1351 |
construct</para> |
| 1352 |
|
| 1353 |
<para><link linkend="dblquo">Double quotes</link> |
| 1354 |
<command>" ... "</command> <firstterm>weak</firstterm> quoting |
| 1355 |
<itemizedlist> |
| 1356 |
<listitem><para><link |
| 1357 |
linkend="quotingbsl"><firstterm>Double-quoting</firstterm> |
| 1358 |
the <firstterm>backslash</firstterm> (<command>\</command>) |
| 1359 |
character</link></para></listitem> |
| 1360 |
</itemizedlist> |
| 1361 |
</para> |
| 1362 |
|
| 1363 |
<para><link linkend="doublespace">Double-spacing a text |
| 1364 |
file</link>, using <link linkend="sedref">sed</link></para> |
| 1365 |
|
| 1366 |
<para>* * *</para> |
| 1367 |
|
| 1368 |
<para><command>-e </command> |
| 1369 |
<link linkend="rtif">File exists</link> test</para> |
| 1370 |
|
| 1371 |
<para><link linkend="echoref">echo</link> |
| 1372 |
<itemizedlist> |
| 1373 |
<listitem><para><link linkend="echogrepref">Feeding commands down |
| 1374 |
a <firstterm>pipe</firstterm></link></para></listitem> |
| 1375 |
<listitem><para><link linkend="echocs">Setting a variable</link> |
| 1376 |
using <link linkend="commandsubref">command |
| 1377 |
substitution</link></para></listitem> |
| 1378 |
<listitem><para><link |
| 1379 |
linkend="binecho"><filename>/bin/echo</filename></link>, |
| 1380 |
external <firstterm>echo</firstterm> command</para></listitem> |
| 1381 |
</itemizedlist></para> |
| 1382 |
|
| 1383 |
<para><link linkend="elifref1">elif</link>, |
| 1384 |
Contraction of <firstterm>else</firstterm> |
| 1385 |
and <link linkend="ifthen">if</link></para> |
| 1386 |
<para><link linkend="elseref">else</link></para> |
| 1387 |
<para>Encrypting files, using <link |
| 1388 |
linkend="opensslref">openssl</link></para> |
| 1389 |
<para><link linkend="caseesac1">esac</link>, keyword terminating |
| 1390 |
<firstterm>case</firstterm> construct</para> |
| 1391 |
<para><link linkend="envref"><firstterm>Environmental</firstterm> |
| 1392 |
variables</link></para> |
| 1393 |
<para><link linkend="equalref"> -eq </link>, |
| 1394 |
<firstterm>is-equal-to</firstterm> <link linkend="icomparison1">integer |
| 1395 |
comparison</link> test</para> |
| 1396 |
<para><link linkend="primes0">Eratosthenes, |
| 1397 |
Sieve of</link>, algorithm for generating prime numbers</para> |
| 1398 |
|
| 1399 |
<para><link linkend="spm">Escaped characters</link>, |
| 1400 |
special meanings of |
| 1401 |
<itemizedlist> |
| 1402 |
<listitem><para>Within <link linkend="strq">$' ... '</link> |
| 1403 |
string expansion</para></listitem> |
| 1404 |
<listitem><para><link linkend="unicoderef2">Used with |
| 1405 |
<firstterm>Unicode</firstterm> characters</link></para></listitem> |
| 1406 |
</itemizedlist> |
| 1407 |
</para> |
| 1408 |
|
| 1409 |
<para><link |
| 1410 |
linkend="fstabref"><filename>/etc/fstab</filename></link> |
| 1411 |
(filesystem mount) file</para> |
| 1412 |
<para><link |
| 1413 |
linkend="datafilesref1"><filename>/etc/passwd</filename></link> |
| 1414 |
(user account) file</para> |
| 1415 |
<para><link linkend="euidref"><varname>$EUID</varname></link>, |
| 1416 |
<firstterm>Effective user ID</firstterm></para> |
| 1417 |
|
| 1418 |
<para><link linkend="evalref">eval</link>, |
| 1419 |
Combine and <firstterm>evaluate</firstterm> expression(s), |
| 1420 |
with variable expansion |
| 1421 |
<itemizedlist> |
| 1422 |
<listitem><para><link linkend="evaleff">Effects |
| 1423 |
of</link>, <firstterm>Example script</firstterm></para></listitem> |
| 1424 |
<listitem><para><link linkend="evalforced">Forces |
| 1425 |
<firstterm>reevaluation</firstterm></link> of |
| 1426 |
arguments</para></listitem> |
| 1427 |
<listitem><para>And <link linkend="evalindref">indirect |
| 1428 |
references</link></para></listitem> |
| 1429 |
<listitem><para><link linkend="evalrisk">Risk of |
| 1430 |
using</link></para></listitem> |
| 1431 |
<listitem><para><link linkend="samorse">Using |
| 1432 |
<firstterm>eval</firstterm> to convert <firstterm>array</firstterm> |
| 1433 |
elements into a command list</link></para></listitem> |
| 1434 |
<listitem><para><link linkend="arrchoice0">Using |
| 1435 |
<firstterm>eval</firstterm> to select among |
| 1436 |
variables</link></para></listitem> |
| 1437 |
</itemizedlist></para> |
| 1438 |
|
| 1439 |
<para><link linkend="dblbraev">Evaluation of |
| 1440 |
<firstterm>octal/hex</firstterm> constants within |
| 1441 |
[[ ... ]]</link></para> |
| 1442 |
|
| 1443 |
<para><link linkend="usingexecref">exec</link> command, |
| 1444 |
using in <link linkend="ioredirref">redirection</link></para> |
| 1445 |
|
| 1446 |
<para><link linkend="exercises">Exercises</link></para> |
| 1447 |
|
| 1448 |
<!-- ********************** --> |
| 1449 |
<para>Exit and Exit status |
| 1450 |
<itemizedlist> |
| 1451 |
<listitem><para><link linkend="exitcommandref">exit</link> |
| 1452 |
command</para></listitem> |
| 1453 |
|
| 1454 |
<listitem> |
| 1455 |
<para><link linkend="exitstatusref">Exit status</link> |
| 1456 |
(<firstterm>exit code</firstterm>, <firstterm>return</firstterm> |
| 1457 |
status of a command)</para> |
| 1458 |
<para><link linkend="exitcodesref"><command>Table</command></link>, |
| 1459 |
<firstterm>Exit |
| 1460 |
codes</firstterm> with special meanings</para> |
| 1461 |
<para> |
| 1462 |
<link linkend="gotchaexitvalanamalies">Anomalous</link> |
| 1463 |
</para> |
| 1464 |
<para><link linkend="excoor">Out of range</link></para> |
| 1465 |
<para><link linkend="pipeex"><firstterm>Pipe</firstterm></link> |
| 1466 |
exit status</para> |
| 1467 |
<para><link linkend="exitreturn1"> |
| 1468 |
Specified by a <firstterm>function |
| 1469 |
return</firstterm></link></para> |
| 1470 |
<para><link |
| 1471 |
linkend="exitsuccess"><firstterm>Successful</firstterm></link>, |
| 1472 |
<command>0</command></para> |
| 1473 |
<para><link |
| 1474 |
linkend="sysexitsref"><filename>/usr/include/sysexits.h</filename></link>, |
| 1475 |
system file listing C/C++ standard exit codes</para> |
| 1476 |
</listitem> |
| 1477 |
|
| 1478 |
</itemizedlist></para> |
| 1479 |
<!-- ********************** --> |
| 1480 |
|
| 1481 |
<para><link linkend="exportref2">Export</link>, |
| 1482 |
to make available variables to <link |
| 1483 |
linkend="childref">child processes</link> |
| 1484 |
<itemizedlist> |
| 1485 |
<listitem><para><link linkend="exportawk">Passing a variable |
| 1486 |
to an embedded <firstterm>awk</firstterm> |
| 1487 |
script</link></para></listitem> |
| 1488 |
</itemizedlist></para> |
| 1489 |
|
| 1490 |
<!-- ********************** --> |
| 1491 |
<para><link linkend="exprref">expr</link>, |
| 1492 |
<firstterm>Expression</firstterm> evaluator |
| 1493 |
<itemizedlist> |
| 1494 |
<listitem><para><link linkend="expextrsub">Substring |
| 1495 |
extraction</link></para></listitem> |
| 1496 |
<listitem><para><link linkend="substringindex2">Substring |
| 1497 |
<firstterm>index</firstterm> (numerical position in |
| 1498 |
string)</link></para></listitem> |
| 1499 |
<listitem><para><link linkend="exprmatch">Substring |
| 1500 |
matching</link></para></listitem> |
| 1501 |
</itemizedlist></para> |
| 1502 |
<!-- ********************** --> |
| 1503 |
|
| 1504 |
<para><link linkend="extregex">Extended <firstterm>Regular |
| 1505 |
Expressions</firstterm></link> |
| 1506 |
<itemizedlist> |
| 1507 |
<listitem><para><command>? </command> (question mark) |
| 1508 |
<link linkend="quexregex">Match zero / one characters</link> |
| 1509 |
</para></listitem> |
| 1510 |
<listitem><para><command>( ... ) </command> |
| 1511 |
<link linkend="parengrps">Group |
| 1512 |
of expressions</link></para></listitem> |
| 1513 |
<listitem><para><command>\{ N \}</command> |
| 1514 |
<link linkend="escpcb"><quote>Curly</quote> brackets</link>, |
| 1515 |
<firstterm>escaped</firstterm>, |
| 1516 |
number of character sets to match</para></listitem> |
| 1517 |
<listitem><para><command>+ </command> |
| 1518 |
<link linkend="plusref"><firstterm>Character |
| 1519 |
match</firstterm></link></para></listitem> |
| 1520 |
</itemizedlist></para> |
| 1521 |
|
| 1522 |
<para>* * *</para> |
| 1523 |
|
| 1524 |
<para><link linkend="factorref">factor</link>, decomposes an |
| 1525 |
integer into its prime factors |
| 1526 |
<itemizedlist> |
| 1527 |
<listitem><para>Application: <link linkend="primes2">Generating |
| 1528 |
prime numbers</link></para></listitem> |
| 1529 |
</itemizedlist></para> |
| 1530 |
|
| 1531 |
<para><link linkend="falseref">false</link>, |
| 1532 |
returns <firstterm>unsuccessful</firstterm> (1) <link |
| 1533 |
linkend="exitstatusref">exit status</link></para> |
| 1534 |
|
| 1535 |
<para><link linkend="fieldref">Field</link>, a group of characters |
| 1536 |
that comprises an item of data</para> |
| 1537 |
|
| 1538 |
<para><link linkend="filearchiv">Files / Archiving</link></para> |
| 1539 |
|
| 1540 |
<para><link linkend="fdref">File descriptors</link></para> |
| 1541 |
<itemizedlist> |
| 1542 |
<listitem><para><link linkend="cfd">Closing</link></para> |
| 1543 |
|
| 1544 |
<para><command>n<&-</command> |
| 1545 |
Close input file descriptor <firstterm>n</firstterm></para> |
| 1546 |
<para><command>0<&-</command>, |
| 1547 |
<command><&-</command> |
| 1548 |
Close <filename>stdin</filename></para> |
| 1549 |
|
| 1550 |
<para><command>n>&-</command> |
| 1551 |
Close output file descriptor <firstterm>n</firstterm></para> |
| 1552 |
<para><command>1>&-</command>, |
| 1553 |
<command>>&-</command> |
| 1554 |
Close <filename>stdout</filename></para> |
| 1555 |
|
| 1556 |
</listitem> |
| 1557 |
|
| 1558 |
<listitem><para><link linkend="fdref1">File handles in |
| 1559 |
<firstterm>C</firstterm></link>, similarity to</para></listitem> |
| 1560 |
|
| 1561 |
</itemizedlist> |
| 1562 |
|
| 1563 |
|
| 1564 |
<para><link linkend="opensslref">File encryption</link></para> |
| 1565 |
|
| 1566 |
<para><link linkend="findref">find</link> |
| 1567 |
<itemizedlist> |
| 1568 |
<listitem><para><command>{} </command> |
| 1569 |
<link linkend="curlybracketsref">Curly |
| 1570 |
brackets</link></para></listitem> |
| 1571 |
<listitem><para><command>\; </command> |
| 1572 |
<link linkend="findref0"><firstterm>Escaped</firstterm> |
| 1573 |
semicolon</link></para></listitem> |
| 1574 |
</itemizedlist></para> |
| 1575 |
|
| 1576 |
<para><link linkend="filterdef">Filter</link> |
| 1577 |
<itemizedlist> |
| 1578 |
<listitem><para><link linkend="filterdash">Using <token>-</token> |
| 1579 |
with file-processing utility as a filter</link></para></listitem> |
| 1580 |
<listitem><para><link linkend="filteroutp"> |
| 1581 |
Feeding output of a filter back to <emphasis>same</emphasis> |
| 1582 |
filter</link></para></listitem> |
| 1583 |
</itemizedlist></para> |
| 1584 |
|
| 1585 |
<para><link linkend="nofloatingpoint">Floating point numbers</link>, |
| 1586 |
Bash does not recognize</para> |
| 1587 |
<para><link linkend="foldref">fold</link>, a filter to wrap lines of |
| 1588 |
text</para> |
| 1589 |
<para><link linkend="forkref">Forking</link> a <firstterm>child</firstterm> |
| 1590 |
process</para> |
| 1591 |
<para><link linkend="forloopref1"><firstterm>for</firstterm> |
| 1592 |
loops</link></para> |
| 1593 |
|
| 1594 |
<para><link linkend="functionref">Functions</link></para> |
| 1595 |
<itemizedlist> |
| 1596 |
<listitem><para><link linkend="passedargs">Arguments |
| 1597 |
passed</link> referred to by position</para></listitem> |
| 1598 |
<listitem><para><link linkend="captureretval">Capturing |
| 1599 |
the return value</link> of a function |
| 1600 |
using <link linkend="echoref">echo</link></para></listitem> |
| 1601 |
<listitem><para><link |
| 1602 |
linkend="colonfname"><firstterm>Colon</firstterm></link> |
| 1603 |
as function name</para></listitem> |
| 1604 |
<listitem><para><link linkend="functdefmust">Definition |
| 1605 |
must precede</link> first call to function</para></listitem> |
| 1606 |
<listitem><para><link linkend="exitreturn1">Exit |
| 1607 |
status</link></para></listitem> |
| 1608 |
<listitem> |
| 1609 |
<para><link |
| 1610 |
linkend="localref1">Local variables</link></para> |
| 1611 |
<para>and <link |
| 1612 |
linkend="locvarrecur">recursion</link></para></listitem> |
| 1613 |
|
| 1614 |
<listitem><para><link linkend="passarray">Passing |
| 1615 |
an <firstterm>array</firstterm></link> to a |
| 1616 |
function</para></listitem> |
| 1617 |
<listitem><para><link |
| 1618 |
linkend="funcpointers">Passing pointers</link> |
| 1619 |
to a function</para></listitem> |
| 1620 |
<listitem><para><link linkend="passedargs">Positional |
| 1621 |
parameters</link></para></listitem> |
| 1622 |
<listitem><para><link |
| 1623 |
linkend="recursionref0">Recursion</link></para></listitem> |
| 1624 |
<listitem><para><link |
| 1625 |
linkend="redstdinfunc1">Redirecting |
| 1626 |
<filename>stdin</filename></link> |
| 1627 |
of a function</para></listitem> |
| 1628 |
|
| 1629 |
<listitem> |
| 1630 |
<para><link linkend="returnref">return</link></para> |
| 1631 |
<para>Multiple <firstterm>return values</firstterm> from |
| 1632 |
a function, |
| 1633 |
<link linkend="stddev">example script</link></para> |
| 1634 |
<para><link linkend="retarray"> |
| 1635 |
Returning an <firstterm>array</firstterm></link> from |
| 1636 |
a function</para> |
| 1637 |
<para><link linkend="rvt"><firstterm>Return</firstterm> |
| 1638 |
range limits</link>, workarounds</para> |
| 1639 |
</listitem> |
| 1640 |
|
| 1641 |
<listitem><para><link |
| 1642 |
linkend="fshiftref"><firstterm>Shift</firstterm> |
| 1643 |
arguments passed</link> to a function</para></listitem> |
| 1644 |
<listitem><para><link |
| 1645 |
linkend="fstrangeref">Unusual function |
| 1646 |
names</link></para></listitem> |
| 1647 |
</itemizedlist> |
| 1648 |
|
| 1649 |
<para>* * *</para> |
| 1650 |
|
| 1651 |
<para>Games and amusements |
| 1652 |
<itemizedlist> |
| 1653 |
<listitem><para><link |
| 1654 |
linkend="agram">Anagrams</link></para></listitem> |
| 1655 |
<listitem><para><link |
| 1656 |
linkend="agram2">Anagrams</link>, again</para></listitem> |
| 1657 |
<listitem><para><link |
| 1658 |
linkend="bingo">Bingo Number Generator</link></para></listitem> |
| 1659 |
<listitem><para><link linkend="cwsolver">Crossword puzzle |
| 1660 |
solver</link></para></listitem> |
| 1661 |
<listitem><para><link |
| 1662 |
linkend="cryptoquote">Crypto-Quotes</link></para></listitem> |
| 1663 |
<listitem><para><link |
| 1664 |
linkend="cards">Dealing a deck of cards</link></para></listitem> |
| 1665 |
<listitem><para><link |
| 1666 |
linkend="fifteen">Fifteen Puzzle</link></para></listitem> |
| 1667 |
<listitem><para><link |
| 1668 |
linkend="horserace">Horse race</link></para></listitem> |
| 1669 |
<listitem><para><link |
| 1670 |
linkend="ktour">Knight's Tour</link></para></listitem> |
| 1671 |
<listitem><para><link linkend="lifeslow"><quote>Life</quote> |
| 1672 |
game</link></para></listitem> |
| 1673 |
<listitem><para><link |
| 1674 |
linkend="msquare">Magic Squares</link></para></listitem> |
| 1675 |
<listitem><para><link linkend="musicscr">Music-playing |
| 1676 |
script</link></para></listitem> |
| 1677 |
<listitem><para><link linkend="nim">Nim</link></para></listitem> |
| 1678 |
<listitem><para><link |
| 1679 |
linkend="brownian">Pachinko</link></para></listitem> |
| 1680 |
<listitem><para><link |
| 1681 |
linkend="qky">Perquackey</link></para></listitem> |
| 1682 |
<listitem><para><link |
| 1683 |
linkend="petals">Petals Around the Rose</link></para></listitem> |
| 1684 |
<listitem><para><link |
| 1685 |
linkend="bashpodder">Podcasting</link></para></listitem> |
| 1686 |
<listitem><para><link linkend="poem">Poem</link></para></listitem> |
| 1687 |
<listitem><para><link linkend="speech00">Speech |
| 1688 |
generation</link></para></listitem> |
| 1689 |
<listitem><para><link |
| 1690 |
linkend="hanoi">Towers of Hanoi</link></para> |
| 1691 |
<para><link linkend="hanoi2">Graphic |
| 1692 |
version</link></para> |
| 1693 |
<para><link linkend="hanoi2a">Alternate graphic |
| 1694 |
version</link></para> |
| 1695 |
</listitem> |
| 1696 |
</itemizedlist></para> |
| 1697 |
|
| 1698 |
<para><link linkend="getopty">getopt</link>, |
| 1699 |
<firstterm>external</firstterm> command for parsing script |
| 1700 |
<firstterm>command-line</firstterm> arguments |
| 1701 |
<itemizedlist> |
| 1702 |
<listitem><para><link linkend="getoptsimple1">Emulated |
| 1703 |
in a script</link></para></listitem> |
| 1704 |
</itemizedlist></para> |
| 1705 |
|
| 1706 |
<para><link linkend="getoptsx">getopts</link>, |
| 1707 |
Bash <firstterm>builtin</firstterm> for parsing script |
| 1708 |
<firstterm>command-line</firstterm> arguments |
| 1709 |
<itemizedlist> |
| 1710 |
<listitem><para><link |
| 1711 |
linkend="getoptsopt"><varname>$OPTIND</varname> / |
| 1712 |
<varname>$OPTARG</varname></link></para></listitem> |
| 1713 |
</itemizedlist></para> |
| 1714 |
|
| 1715 |
<para><link linkend="scoperef">Global</link> |
| 1716 |
variable</para> |
| 1717 |
|
| 1718 |
<para><link linkend="globbingref2">Globbing</link>, |
| 1719 |
filename expansion |
| 1720 |
<itemizedlist> |
| 1721 |
<listitem><para><link linkend="handlingfnames">Handling |
| 1722 |
filenames correctly</link></para></listitem> |
| 1723 |
<listitem><para><link linkend="asteriskref"><firstterm>Wild |
| 1724 |
cards</firstterm></link></para></listitem> |
| 1725 |
<listitem><para><link linkend="wdotfilewc">Will not match |
| 1726 |
<filename>dot files</filename></link></para></listitem> |
| 1727 |
</itemizedlist></para> |
| 1728 |
|
| 1729 |
<para><link linkend="goldenratio">Golden Ratio</link> |
| 1730 |
(<firstterm>Phi</firstterm>)</para> |
| 1731 |
|
| 1732 |
<para><link linkend="ge0ref"> -ge </link>, |
| 1733 |
<firstterm>greater-than or equal</firstterm> |
| 1734 |
<link linkend="icomparison1">integer comparison</link> test</para> |
| 1735 |
<para><link linkend="gt0ref"> -gt </link>, |
| 1736 |
<firstterm>greater-than</firstterm> <link linkend="icomparison1">integer |
| 1737 |
comparison</link> test</para> |
| 1738 |
<para><link linkend="groffref"><firstterm>groff</firstterm></link>, |
| 1739 |
text markup and formatting language</para> |
| 1740 |
<para><link linkend="gronsfeld">Gronsfeld cipher</link></para> |
| 1741 |
<para><link linkend="groupsref"><varname>$GROUPS</varname></link>, |
| 1742 |
<firstterm>Groups</firstterm> user belongs to</para> |
| 1743 |
<para><link linkend="gzipref">gzip</link>, compression utility</para> |
| 1744 |
|
| 1745 |
<para>* * *</para> |
| 1746 |
|
| 1747 |
<para><link linkend="hashref">Hashing</link>, creating lookup keys |
| 1748 |
in a table |
| 1749 |
<itemizedlist> |
| 1750 |
<listitem><para><link linkend="hashex2_0"><firstterm>Example |
| 1751 |
script</firstterm></link></para></listitem> |
| 1752 |
</itemizedlist></para> |
| 1753 |
|
| 1754 |
<para><link linkend="headref">head</link>, <firstterm>echo</firstterm> |
| 1755 |
to <filename>stdout</filename> lines at the beginning of a text |
| 1756 |
file</para> |
| 1757 |
<para><link linkend="helpref">help</link>, gives usage summary of |
| 1758 |
a Bash <link linkend="builtinref">builtin</link></para> |
| 1759 |
|
| 1760 |
<!-- ********************** --> |
| 1761 |
<para><link linkend="heredocref"><firstterm>Here</firstterm> |
| 1762 |
documents</link> |
| 1763 |
|
| 1764 |
<itemizedlist> |
| 1765 |
|
| 1766 |
<listitem> |
| 1767 |
<para><link linkend="anonheredoc0"><firstterm>Anonymous</firstterm> |
| 1768 |
here documents</link>, using <command>:</command></para> |
| 1769 |
<para><link linkend="cblock1">Commenting out</link> |
| 1770 |
blocks of code</para> |
| 1771 |
<para><link linkend="hselfdoc">Self-documenting</link> |
| 1772 |
scripts</para> |
| 1773 |
</listitem> |
| 1774 |
<listitem><para><link |
| 1775 |
linkend="bcheredoc"><firstterm>bc</firstterm> in a <firstterm>here |
| 1776 |
document</firstterm></link></para></listitem> |
| 1777 |
|
| 1778 |
<listitem><para><link linkend="catscriptref"><firstterm>cat</firstterm> |
| 1779 |
scripts</link></para></listitem> |
| 1780 |
<listitem><para><link linkend="herecs">Command |
| 1781 |
substitution</link></para></listitem> |
| 1782 |
<listitem><para><link linkend="exscriptref"><firstterm>ex</firstterm> |
| 1783 |
scripts</link></para></listitem> |
| 1784 |
<listitem><para><link |
| 1785 |
linkend="herefunc"><firstterm>Function</firstterm></link>, |
| 1786 |
supplying input to</para></listitem> |
| 1787 |
|
| 1788 |
<listitem> |
| 1789 |
<para><link |
| 1790 |
linkend="herestringsref"><firstterm>Here</firstterm> |
| 1791 |
strings</link></para> |
| 1792 |
<para>Calculating the <link linkend="goldenratio">Golden |
| 1793 |
Ratio</link></para> |
| 1794 |
<para><link linkend="hspre">Prepending text</link></para> |
| 1795 |
<para><link linkend="hsloop">As the <filename>stdin</filename> of a |
| 1796 |
<firstterm>loop</firstterm></link></para> |
| 1797 |
<para><link linkend="hsread">Using |
| 1798 |
<firstterm>read</firstterm></link></para> |
| 1799 |
</listitem> |
| 1800 |
|
| 1801 |
<listitem><para><link |
| 1802 |
linkend="limitstringref"><firstterm>Limit</firstterm> |
| 1803 |
string</link></para> |
| 1804 |
<para><link linkend="exclls"><token>!</token> as a |
| 1805 |
<firstterm>limit string</firstterm></link></para> |
| 1806 |
<para><link linkend="indentedls">Closing <firstterm>limit |
| 1807 |
string</firstterm></link> may not be indented</para> |
| 1808 |
<para><link linkend="limitstrdash">Dash option</link> |
| 1809 |
to limit string, <option><<-LimitString</option> |
| 1810 |
</para></listitem> |
| 1811 |
<listitem><para><link linkend="herelit">Literal |
| 1812 |
text output</link>, |
| 1813 |
for generating program code</para></listitem> |
| 1814 |
|
| 1815 |
<listitem> |
| 1816 |
<para><link linkend="hereparamsub">Parameter |
| 1817 |
substitution</link></para> |
| 1818 |
<para><link linkend="hereesc">Disabling</link> |
| 1819 |
<firstterm>parameter substitution</firstterm></para> |
| 1820 |
</listitem> |
| 1821 |
|
| 1822 |
<listitem><para><link linkend="herepassp">Passing |
| 1823 |
parameters</link></para></listitem> |
| 1824 |
<listitem><para><link linkend="heretemp">Temporary |
| 1825 |
files</link></para></listitem> |
| 1826 |
<listitem><para><link linkend="vihere">Using |
| 1827 |
<firstterm>vi</firstterm> non-interactively</link></para></listitem> |
| 1828 |
</itemizedlist></para> |
| 1829 |
<!-- ********************** --> |
| 1830 |
|
| 1831 |
<para><link linkend="histcommands">History commands</link></para> |
| 1832 |
|
| 1833 |
<para><link linkend="homedirref"><varname>$HOME</varname></link>, |
| 1834 |
<firstterm>user's home directory</firstterm></para> |
| 1835 |
<para><link linkend="homework">Homework assignment solver</link></para> |
| 1836 |
<para><link linkend="hostnameref"><varname>$HOSTNAME</varname></link>, |
| 1837 |
system <firstterm>host name</firstterm></para> |
| 1838 |
|
| 1839 |
<para>* * *</para> |
| 1840 |
|
| 1841 |
<!-- ********************** --> |
| 1842 |
<para><link linkend="rcsref"><varname>$Id</varname> |
| 1843 |
parameter</link>, in <firstterm>rcs</firstterm> (Revision Control |
| 1844 |
System)</para> |
| 1845 |
|
| 1846 |
<para><link linkend="ifthen">if [ condition ]; then ...</link> |
| 1847 |
<firstterm>test</firstterm> construct |
| 1848 |
<itemizedlist> |
| 1849 |
|
| 1850 |
<listitem> |
| 1851 |
<para><link linkend="ifgrepref">if-grep</link>, |
| 1852 |
<firstterm>if</firstterm> and <link linkend="grepref">grep</link> |
| 1853 |
in combination</para> |
| 1854 |
<para><link linkend="ifgrepfix">Fixup</link> |
| 1855 |
for <firstterm>if-grep</firstterm> test</para> |
| 1856 |
</listitem> |
| 1857 |
|
| 1858 |
</itemizedlist></para> |
| 1859 |
<!-- ********************** --> |
| 1860 |
|
| 1861 |
<para><link linkend="ifsref"><varname>$IFS</varname></link>, |
| 1862 |
<firstterm>Internal field separator</firstterm> variable |
| 1863 |
<itemizedlist> |
| 1864 |
<listitem><para><link linkend="ifsws">Defaults to |
| 1865 |
<firstterm>whitespace</firstterm></link></para></listitem> |
| 1866 |
</itemizedlist></para> |
| 1867 |
|
| 1868 |
<para><link linkend="icomparison1">Integer comparison |
| 1869 |
operators</link></para> |
| 1870 |
<para><link linkend="doinref">in</link>, |
| 1871 |
<firstterm>keyword</firstterm> preceding |
| 1872 |
<varname>[list]</varname> in a <firstterm>for</firstterm> |
| 1873 |
loop</para> |
| 1874 |
<para><link linkend="inittabref">Initialization table</link>, |
| 1875 |
<filename>/etc/inittab</filename></para> |
| 1876 |
<para><link linkend="codeblockref">Inline group</link>, |
| 1877 |
i.e., code block</para> |
| 1878 |
<para><link linkend="iitest">Interactive script</link>, test for</para> |
| 1879 |
<para><link linkend="ioredirref">I/O redirection</link></para> |
| 1880 |
|
| 1881 |
<!-- ********************** --> |
| 1882 |
<para><link linkend="ivrref">Indirect referencing of variables</link> |
| 1883 |
<itemizedlist> |
| 1884 |
<listitem><para><link linkend="ivr2">New notation</link>, introduced |
| 1885 |
in <link linkend="bash2ref">version 2</link> of Bash (<link |
| 1886 |
linkend="varrefnew"> example script</link>)</para></listitem> |
| 1887 |
</itemizedlist></para> |
| 1888 |
<!-- ********************** --> |
| 1889 |
|
| 1890 |
|
| 1891 |
<para><link linkend="iptablesref">iptables</link>, |
| 1892 |
packet filtering and firewall utility |
| 1893 |
<itemizedlist> |
| 1894 |
<listitem><para><link linkend="iptables01">Usage |
| 1895 |
example</link></para></listitem> |
| 1896 |
<listitem><para><link linkend="iptables02">Example |
| 1897 |
script</link></para></listitem> |
| 1898 |
</itemizedlist></para> |
| 1899 |
|
| 1900 |
|
| 1901 |
<para><link linkend="iterationref">Iteration</link></para> |
| 1902 |
|
| 1903 |
<para>* * *</para> |
| 1904 |
|
| 1905 |
|
| 1906 |
<para><link linkend="jobidtable0">Job IDs</link>, table</para> |
| 1907 |
<para><link linkend="jotref">jot</link>, |
| 1908 |
Emit a sequence of integers. Equivalent to <link |
| 1909 |
linkend="seqref">seq</link>. |
| 1910 |
<itemizedlist> |
| 1911 |
<listitem><para><link linkend="jotrandom">Random sequence |
| 1912 |
generation</link></para></listitem> |
| 1913 |
</itemizedlist></para> |
| 1914 |
<para><link linkend="jabh">Just another Bash hacker!</link></para> |
| 1915 |
|
| 1916 |
<para>* * *</para> |
| 1917 |
|
| 1918 |
<para><link linkend="keywordref">Keywords</link> |
| 1919 |
<itemizedlist> |
| 1920 |
<listitem><para><link linkend="missingkeyword">error</link>, |
| 1921 |
if missing</para></listitem> |
| 1922 |
</itemizedlist></para> |
| 1923 |
|
| 1924 |
<para><link linkend="killref">kill</link>, |
| 1925 |
terminate a process by <link linkend="processiddef">process ID</link> |
| 1926 |
<itemizedlist> |
| 1927 |
<listitem><para><link |
| 1928 |
linkend="zombieref">Options</link> (<option>-l</option>, |
| 1929 |
<option>-9</option>)</para></listitem> |
| 1930 |
</itemizedlist></para> |
| 1931 |
|
| 1932 |
<para><link linkend="killallref">killall</link>, |
| 1933 |
terminate a process <emphasis>by name</emphasis></para> |
| 1934 |
<para><link linkend="killall2ref"><firstterm>killall |
| 1935 |
script</firstterm></link> in <filename |
| 1936 |
class="directory">/etc/rc.d/init.d</filename></para> |
| 1937 |
|
| 1938 |
<para>* * *</para> |
| 1939 |
|
| 1940 |
<para><link linkend="lastpiperef">lastpipe</link> shell |
| 1941 |
option</para> |
| 1942 |
|
| 1943 |
<para><link linkend="le0ref"> -le </link>, |
| 1944 |
<firstterm>less-than or equal</firstterm> |
| 1945 |
<link linkend="icomparison1">integer comparison</link> test</para> |
| 1946 |
|
| 1947 |
<para><link linkend="letref">let</link>, |
| 1948 |
setting and carrying out arithmetic operations on variables |
| 1949 |
<itemizedlist> |
| 1950 |
<listitem><para><firstterm>C-style</firstterm> |
| 1951 |
<link linkend="ex46">increment and decrement |
| 1952 |
operators</link></para></listitem> |
| 1953 |
</itemizedlist></para> |
| 1954 |
|
| 1955 |
<para><link linkend="limitstringref">Limit string</link>, |
| 1956 |
in a <link linkend="heredocref">here document</link></para> |
| 1957 |
<para><link linkend="linenoref"><varname>$LINENO</varname></link>, |
| 1958 |
variable indicating the <firstterm>line number</firstterm> where |
| 1959 |
it appears in a script</para> |
| 1960 |
|
| 1961 |
<para><link linkend="linkref">Link</link>, file |
| 1962 |
(using <firstterm>ln</firstterm> command) |
| 1963 |
<itemizedlist> |
| 1964 |
<listitem><para><link |
| 1965 |
linkend="linkminvok">Invoking script with multiple names</link>, |
| 1966 |
using <firstterm>ln</firstterm></para></listitem> |
| 1967 |
<listitem><para><link |
| 1968 |
linkend="symlinkref"><firstterm>symbolic</firstterm> |
| 1969 |
links</link>, <firstterm>ln -s </firstterm></para></listitem> |
| 1970 |
</itemizedlist></para> |
| 1971 |
|
| 1972 |
<para><link linkend="listconsref">List constructs</link> |
| 1973 |
<itemizedlist> |
| 1974 |
|
| 1975 |
<listitem><para><link linkend="lcons1"><firstterm>And</firstterm> |
| 1976 |
list</link></para></listitem> |
| 1977 |
<listitem><para><link linkend="orlistref"><firstterm>Or</firstterm> |
| 1978 |
list</link></para></listitem> |
| 1979 |
</itemizedlist></para> |
| 1980 |
|
| 1981 |
<para><link linkend="localref1">Local variables</link> |
| 1982 |
<itemizedlist> |
| 1983 |
<listitem><para>and <link |
| 1984 |
linkend="locvarrecur">recursion</link></para></listitem> |
| 1985 |
</itemizedlist></para> |
| 1986 |
|
| 1987 |
<para><link linkend="localization">Localization</link></para> |
| 1988 |
|
| 1989 |
<para><link linkend="logops1">Logical operators</link> |
| 1990 |
(<varname>&&</varname>, <varname>||</varname>, |
| 1991 |
etc.)</para> |
| 1992 |
<para><link linkend="logoutfileref1">Logout file</link>, |
| 1993 |
the <filename>~/.bash_logout</filename> file</para> |
| 1994 |
<para><link linkend="isomountref0">Loopback device</link>, |
| 1995 |
mounting a file on a <link linkend="blockdevref">block |
| 1996 |
device</link></para> |
| 1997 |
|
| 1998 |
|
| 1999 |
<para><link linkend="loops1">Loops</link> |
| 2000 |
<itemizedlist> |
| 2001 |
|
| 2002 |
<listitem><para><link linkend="brkcont1">break</link> |
| 2003 |
loop control command</para></listitem> |
| 2004 |
<listitem><para><link linkend="brkcont1">continue</link> loop |
| 2005 |
control command</para></listitem> |
| 2006 |
|
| 2007 |
<listitem> |
| 2008 |
<para><firstterm>C</firstterm>-style |
| 2009 |
loop within <link linkend="dblparensref">double |
| 2010 |
parentheses</link></para> |
| 2011 |
<para><link |
| 2012 |
linkend="loopcstyle"><firstterm>for</firstterm> loop</link></para> |
| 2013 |
<para><link |
| 2014 |
linkend="wloopcstyle"><firstterm>while</firstterm> loop</link></para> |
| 2015 |
</listitem> |
| 2016 |
|
| 2017 |
<listitem><para><link linkend="doinref">do</link> (keyword), |
| 2018 |
begins execution of commands within a loop</para></listitem> |
| 2019 |
<listitem><para><link linkend="doinref">done</link> (keyword), |
| 2020 |
terminates a loop</para></listitem> |
| 2021 |
|
| 2022 |
<listitem> |
| 2023 |
<para><link linkend="forloopref1"><firstterm>for</firstterm> |
| 2024 |
loops</link></para> |
| 2025 |
<para><replaceable>for</replaceable> <varname>arg</varname> |
| 2026 |
<replaceable>in</replaceable> <varname>[list]</varname>; |
| 2027 |
<replaceable>do</replaceable></para> |
| 2028 |
|
| 2029 |
<para><link linkend="loopcs"><firstterm>Command |
| 2030 |
substitution</firstterm> to generate |
| 2031 |
<varname>[list]</varname></link></para> |
| 2032 |
<para><link linkend="liglob">Filename expansion |
| 2033 |
in <varname>[list]</varname></link></para> |
| 2034 |
<para><link linkend="multparaml">Multiple parameters |
| 2035 |
in each <varname>[list]</varname> element</link></para> |
| 2036 |
<para><link linkend="omitlist">Omitting |
| 2037 |
<varname>[list]</varname></link>, defaults to |
| 2038 |
<link linkend="posparamref">positional parameters</link></para> |
| 2039 |
<para><link linkend="paramli">Parameterizing |
| 2040 |
<varname>[list]</varname></link></para> |
| 2041 |
<para><link |
| 2042 |
linkend="loopredir">Redirection</link></para> |
| 2043 |
</listitem> |
| 2044 |
|
| 2045 |
<listitem><para><link linkend="doinref">in</link>, |
| 2046 |
(keyword) preceding [list] in a |
| 2047 |
<firstterm>for</firstterm> loop</para></listitem> |
| 2048 |
<listitem><para><link linkend="nestedloops">Nested |
| 2049 |
loops</link></para></listitem> |
| 2050 |
<listitem><para><link linkend="bgloop0">Running a |
| 2051 |
loop <emphasis>in the background</emphasis></link>, |
| 2052 |
<firstterm>script example</firstterm></para></listitem> |
| 2053 |
|
| 2054 |
<listitem> |
| 2055 |
<para>Semicolon required, when <firstterm>do</firstterm> is on first line |
| 2056 |
of loop</para> |
| 2057 |
<para><link linkend="needsemicolon"><firstterm>for</firstterm> |
| 2058 |
loop</link></para> |
| 2059 |
<para><link linkend="whileneedsemi"><firstterm>while</firstterm> |
| 2060 |
loop</link></para> |
| 2061 |
</listitem> |
| 2062 |
|
| 2063 |
<listitem><para><link linkend="untilloopref">until</link> loop</para> |
| 2064 |
<para><replaceable>until [ condition-is-true ]; do</replaceable> |
| 2065 |
</para></listitem> |
| 2066 |
|
| 2067 |
<listitem><para><link linkend="whileloopref">while</link> |
| 2068 |
loop</para> |
| 2069 |
<para><replaceable>while [ condition ]; do</replaceable></para> |
| 2070 |
|
| 2071 |
<para><link linkend="whilefunc">Function call</link> |
| 2072 |
inside test brackets</para> |
| 2073 |
<para><link linkend="whmultcond">Multiple conditions</link></para> |
| 2074 |
<para><link linkend="whilenobrackets">Omitting <firstterm>test |
| 2075 |
brackets</firstterm></link></para> |
| 2076 |
<para><link |
| 2077 |
linkend="whredir">Redirection</link></para> |
| 2078 |
<para><link linkend="whilereadref2"> |
| 2079 |
<firstterm>while read</firstterm></link> construct</para> |
| 2080 |
</listitem> |
| 2081 |
|
| 2082 |
<listitem><para><link linkend="chooseloop">Which type of loop to |
| 2083 |
use</link></para></listitem> |
| 2084 |
|
| 2085 |
</itemizedlist></para> |
| 2086 |
|
| 2087 |
|
| 2088 |
<para>Loopback devices |
| 2089 |
<itemizedlist> |
| 2090 |
<listitem><para><link linkend="loopbackref">In <filename |
| 2091 |
class="directory">/dev</filename> directory</link></para></listitem> |
| 2092 |
<listitem><para><link |
| 2093 |
linkend="isomountref0">Mounting an ISO image</link></para></listitem> |
| 2094 |
</itemizedlist></para> |
| 2095 |
|
| 2096 |
|
| 2097 |
<para><link linkend="lt0ref"> -lt </link>, |
| 2098 |
<firstterm>less-than</firstterm> <link linkend="icomparison1">integer |
| 2099 |
comparison</link> test</para> |
| 2100 |
|
| 2101 |
<para>* * *</para> |
| 2102 |
|
| 2103 |
<para><link linkend="m4ref">m4</link>, macro processing language</para> |
| 2104 |
<para><link linkend="machtyperef"><varname>$MACHTYPE</varname></link>, |
| 2105 |
<firstterm>Machine type</firstterm></para> |
| 2106 |
<para><link linkend="magnumref">Magic number</link>, |
| 2107 |
marker at the head of a file indicating the file type</para> |
| 2108 |
<para><link linkend="makefileref"><filename>Makefile</filename></link>, |
| 2109 |
file containing the list of dependencies used by <link |
| 2110 |
linkend="makeref">make</link> command</para> |
| 2111 |
|
| 2112 |
<para><link linkend="manref">man</link>, <firstterm>manual |
| 2113 |
page</firstterm> (lookup) |
| 2114 |
<itemizedlist> |
| 2115 |
<listitem><para><link linkend="maned"><firstterm>Man page</firstterm> |
| 2116 |
editor</link> (script)</para></listitem> |
| 2117 |
</itemizedlist> |
| 2118 |
</para> |
| 2119 |
|
| 2120 |
<para><link linkend="mapfileref">mapfile</link> builtin, |
| 2121 |
loads an array with a text file</para> |
| 2122 |
<para><link linkend="mathc">Math commands</link></para> |
| 2123 |
<para><link linkend="metameaningref">Meta-meaning</link></para> |
| 2124 |
|
| 2125 |
<para><link linkend="samorse">Morse code training</link> script</para> |
| 2126 |
|
| 2127 |
<para><link linkend="moduloref">Modulo</link>, arithmetic |
| 2128 |
<firstterm>remainder</firstterm> operator |
| 2129 |
<itemizedlist> |
| 2130 |
<listitem><para>Application: <link linkend="primes1">Generating |
| 2131 |
prime numbers</link></para></listitem> |
| 2132 |
</itemizedlist></para> |
| 2133 |
<para><link linkend="monthlypmt0">Mortgage calculations</link>, |
| 2134 |
<firstterm>example script</firstterm></para> |
| 2135 |
|
| 2136 |
<para>* * *</para> |
| 2137 |
|
| 2138 |
<para><command>-n </command> |
| 2139 |
<link linkend="stringnotnull">String not |
| 2140 |
<firstterm>null</firstterm></link> test</para> |
| 2141 |
<para><link linkend="namedpiperef">Named pipe</link>, a temporary |
| 2142 |
FIFO buffer |
| 2143 |
<itemizedlist> |
| 2144 |
<listitem><para><link linkend="zfifo"><firstterm>Example |
| 2145 |
script</firstterm></link></para></listitem> |
| 2146 |
</itemizedlist></para> |
| 2147 |
|
| 2148 |
<para><link linkend="ncref">nc</link>, <firstterm>netcat</firstterm>, |
| 2149 |
a network toolkit for TCP and UDP ports</para> |
| 2150 |
<para><link linkend="nequalref">-ne</link>, |
| 2151 |
<firstterm>not-equal-to</firstterm> <link |
| 2152 |
linkend="icomparison1">integer comparison</link> test</para> |
| 2153 |
<para><link linkend="notref">Negation operator</link>, |
| 2154 |
<command>!</command>, reverses the sense of a <link |
| 2155 |
linkend="ifthen">test</link></para> |
| 2156 |
<para><link linkend="netstatref">netstat</link>, Network |
| 2157 |
statistics</para> |
| 2158 |
<para><link linkend="networkprogramming">Network programming</link></para> |
| 2159 |
<para><link linkend="nlref">nl</link>, a filter to number lines of |
| 2160 |
text</para> |
| 2161 |
<para><link linkend="noclobberref"><firstterm>Noclobber</firstterm></link>, |
| 2162 |
<option>-C</option> option to Bash to prevent overwriting |
| 2163 |
of files</para> |
| 2164 |
<para><link linkend="logops1"><firstterm>NOT</firstterm> logical |
| 2165 |
operator</link>, <command>!</command></para> |
| 2166 |
<para><link linkend="nullvar"><firstterm>null</firstterm> variable |
| 2167 |
assignment</link>, avoiding</para> |
| 2168 |
|
| 2169 |
<para>* * *</para> |
| 2170 |
|
| 2171 |
<para><command>-o </command> |
| 2172 |
<link linkend="compoundor">Logical OR</link> |
| 2173 |
compound comparison test</para> |
| 2174 |
|
| 2175 |
<para>Obfuscation |
| 2176 |
<itemizedlist> |
| 2177 |
<listitem><para><link |
| 2178 |
linkend="colonfname"><firstterm>Colon</firstterm></link> |
| 2179 |
as function name</para></listitem> |
| 2180 |
<listitem><para><link |
| 2181 |
linkend="homework">Homework assignment</link></para></listitem> |
| 2182 |
<listitem><para><link linkend="jabh">Just another Bash |
| 2183 |
hacker!</link></para> |
| 2184 |
</listitem> |
| 2185 |
</itemizedlist> |
| 2186 |
</para> |
| 2187 |
|
| 2188 |
<para><link linkend="octalref">octal</link>, base-8 numbers</para> |
| 2189 |
<para><link linkend="odref">od</link>, <firstterm>octal |
| 2190 |
dump</firstterm></para> |
| 2191 |
<para><link linkend="oldpwd"><varname>$OLDPWD</varname></link> |
| 2192 |
Previous working directory</para> |
| 2193 |
|
| 2194 |
<para><link linkend="opensslref">openssl</link> encryption |
| 2195 |
utility</para> |
| 2196 |
<para>Operator |
| 2197 |
<itemizedlist> |
| 2198 |
<listitem><para><link linkend="operatordef">Definition |
| 2199 |
of</link></para></listitem> |
| 2200 |
<listitem><para><link |
| 2201 |
linkend="opprecedence1">Precedence</link></para></listitem> |
| 2202 |
</itemizedlist></para> |
| 2203 |
<para><link linkend="optionsref">Options</link>, |
| 2204 |
passed to shell or script on command line or by <link |
| 2205 |
linkend="setref">set</link> command</para> |
| 2206 |
<para><link linkend="orlistref"><firstterm>Or</firstterm> |
| 2207 |
list</link></para> |
| 2208 |
<para><link linkend="orref"><firstterm>Or</firstterm> logical |
| 2209 |
operator</link>, <command>||</command></para> |
| 2210 |
|
| 2211 |
<para>* * *</para> |
| 2212 |
|
| 2213 |
|
| 2214 |
<!-- ********************** --> |
| 2215 |
<para><link linkend="paramsubref">Parameter |
| 2216 |
substitution</link> |
| 2217 |
<itemizedlist> |
| 2218 |
|
| 2219 |
<listitem> |
| 2220 |
<para><firstterm>${parameter+alt_value}</firstterm></para> |
| 2221 |
<para><firstterm>${parameter:+alt_value}</firstterm></para> |
| 2222 |
<para><link linkend="paramaltv">Alternate value</link> |
| 2223 |
of parameter, if set</para> |
| 2224 |
</listitem> |
| 2225 |
<listitem> |
| 2226 |
<para><firstterm>${parameter-default}</firstterm></para> |
| 2227 |
<para><firstterm>${parameter:-default}</firstterm></para> |
| 2228 |
<para><firstterm>${parameter=default}</firstterm></para> |
| 2229 |
<para><firstterm>${parameter:=default}</firstterm></para> |
| 2230 |
<para><link linkend="defparam1">Default |
| 2231 |
parameters</link></para></listitem> |
| 2232 |
<listitem> |
| 2233 |
<para><firstterm>${!varprefix*}</firstterm></para> |
| 2234 |
<para><firstterm>${!varprefix@}</firstterm></para> |
| 2235 |
<para><link linkend="varprefixm">Parameter |
| 2236 |
<emphasis>name</emphasis> match</link></para> |
| 2237 |
</listitem> |
| 2238 |
<listitem> |
| 2239 |
<para><firstterm>${parameter?err_msg}</firstterm></para> |
| 2240 |
<para><link linkend="qerrmsg">Parameter-unset message</link></para> |
| 2241 |
</listitem> |
| 2242 |
<listitem> |
| 2243 |
<para><firstterm>${parameter}</firstterm></para> |
| 2244 |
<para><link linkend="pssub1">Value of |
| 2245 |
<firstterm>parameter</firstterm></link></para> |
| 2246 |
</listitem> |
| 2247 |
|
| 2248 |
<listitem><para><link linkend="casemodparamsub"> |
| 2249 |
<firstterm>Case modification</firstterm></link> |
| 2250 |
(<link linkend="bash4ref">version 4+</link> of |
| 2251 |
Bash).</para></listitem> |
| 2252 |
|
| 2253 |
<listitem><para><link linkend="pw0"><firstterm>Script |
| 2254 |
example</firstterm></link></para></listitem> |
| 2255 |
<listitem><para><link linkend="parsubtab"><command>Table</command></link> |
| 2256 |
of <firstterm>parameter |
| 2257 |
substitution</firstterm></para></listitem> |
| 2258 |
|
| 2259 |
</itemizedlist></para> |
| 2260 |
<!-- ********************** --> |
| 2261 |
|
| 2262 |
<para><link linkend="parchildprobref">Parent / child process |
| 2263 |
problem</link>, a <firstterm>child</firstterm> process cannot |
| 2264 |
<link linkend="exportref">export</link> variables to a <link |
| 2265 |
linkend="forkref">parent process</link></para> |
| 2266 |
|
| 2267 |
<!-- ********************** --> |
| 2268 |
<para>Parentheses |
| 2269 |
<itemizedlist> |
| 2270 |
<listitem><para><link linkend="parensref">Command |
| 2271 |
group</link></para></listitem> |
| 2272 |
<listitem><para><link linkend="parengrps">Enclose group</link> |
| 2273 |
of <firstterm>Extended Regular |
| 2274 |
Expressions</firstterm></para></listitem> |
| 2275 |
<listitem><para><link linkend="dblparensref">Double parentheses</link>, |
| 2276 |
in arithmetic expansion</para></listitem> |
| 2277 |
</itemizedlist></para> |
| 2278 |
<!-- ********************** --> |
| 2279 |
|
| 2280 |
<para><link linkend="pathref"><varname>$PATH</varname></link>, |
| 2281 |
the <firstterm>path</firstterm> (location of system |
| 2282 |
binaries) |
| 2283 |
<itemizedlist> |
| 2284 |
<listitem><para>Appending directories to <varname>$PATH</varname> |
| 2285 |
<link linkend="pathappend">using the <varname>+=</varname> |
| 2286 |
operator</link>.</para></listitem> |
| 2287 |
</itemizedlist></para> |
| 2288 |
|
| 2289 |
<para><link linkend="pathnameref">Pathname</link>, |
| 2290 |
a <filename>filename</filename> that incorporates the complete |
| 2291 |
<firstterm>path</firstterm> of a given file. |
| 2292 |
<itemizedlist> |
| 2293 |
<listitem><para><link linkend="pathmanagement">Parsing |
| 2294 |
<firstterm>pathnames</firstterm></link></para></listitem> |
| 2295 |
</itemizedlist></para> |
| 2296 |
|
| 2297 |
<para><link linkend="perlref">Perl</link>, programming language |
| 2298 |
<itemizedlist> |
| 2299 |
<listitem><para><link linkend="bashandperl0">Combined</link> in the |
| 2300 |
same file with a <firstterm>Bash</firstterm> script</para></listitem> |
| 2301 |
<listitem><para><link linkend="perlemb">Embedded</link> in a |
| 2302 |
<firstterm>Bash</firstterm> script</para></listitem> |
| 2303 |
</itemizedlist></para> |
| 2304 |
|
| 2305 |
<para><link linkend="qky"><emphasis>Perquackey</emphasis>-type |
| 2306 |
anagramming game</link> (<emphasis>Quackey</emphasis> script)</para> |
| 2307 |
|
| 2308 |
<para><link linkend="petals"><emphasis>Petals Around the |
| 2309 |
Rose</emphasis></link></para> |
| 2310 |
|
| 2311 |
<para><link linkend="processiddef">PID</link>, |
| 2312 |
<firstterm>Process ID</firstterm>, an identification |
| 2313 |
number assigned to a running process.</para> |
| 2314 |
|
| 2315 |
<!-- ********************** --> |
| 2316 |
<para><link linkend="piperef">Pipe</link>, <command>| </command>, |
| 2317 |
a device for passing the output of a command to another command |
| 2318 |
or to the shell |
| 2319 |
|
| 2320 |
<itemizedlist> |
| 2321 |
<listitem><para><link linkend="catabuse">Avoiding |
| 2322 |
unnecessary commands</link> in a |
| 2323 |
<firstterm>pipe</firstterm></para></listitem> |
| 2324 |
<listitem><para><link |
| 2325 |
linkend="comminpipe"><firstterm>Comments</firstterm> embedded |
| 2326 |
within</link></para></listitem> |
| 2327 |
<listitem><para><link linkend="pipeex">Exit status</link> |
| 2328 |
of a pipe</para></listitem> |
| 2329 |
<listitem><para><link linkend="pipefailref">Pipefail</link>, |
| 2330 |
<firstterm>set -o pipefail</firstterm> |
| 2331 |
option to indicate <link linkend="exitstatusref">exit status</link> |
| 2332 |
within a <firstterm>pipe</firstterm></para></listitem> |
| 2333 |
<listitem><para><link |
| 2334 |
linkend="pipestatusref"><varname>$PIPESTATUS</varname></link>, |
| 2335 |
<firstterm>exit status</firstterm> of last executed |
| 2336 |
pipe</para></listitem> |
| 2337 |
<listitem><para><link linkend="ucref">Piping output of a command</link> |
| 2338 |
to a script</para></listitem> |
| 2339 |
<listitem><para><link linkend="catlesseff">Redirecting |
| 2340 |
<filename>stdin</filename></link>, rather than using |
| 2341 |
<link linkend="catref">cat</link> in a |
| 2342 |
<firstterm>pipe</firstterm></para></listitem> |
| 2343 |
</itemizedlist></para> |
| 2344 |
<!-- ********************** --> |
| 2345 |
|
| 2346 |
<para><link linkend="gotchas">Pitfalls</link> |
| 2347 |
<itemizedlist> |
| 2348 |
|
| 2349 |
<listitem><para><link linkend="dashnredr"><command>-</command> |
| 2350 |
(dash) is <emphasis>not</emphasis> redirection |
| 2351 |
operator</link></para></listitem> |
| 2352 |
<listitem><para><link linkend="doubleslashref"><command>// |
| 2353 |
</command> (double forward slash)</link>, behavior of <link |
| 2354 |
linkend="cdref">cd</link> command toward</para></listitem> |
| 2355 |
<listitem><para><link linkend="binsh"><token>#!/bin/sh</token></link> |
| 2356 |
script header disables <link |
| 2357 |
linkend="bashcompat">extended <firstterm>Bash</firstterm> |
| 2358 |
features</link></para></listitem> |
| 2359 |
<listitem><para><link linkend="catabuse">Abuse of |
| 2360 |
<firstterm>cat</firstterm></link></para></listitem> |
| 2361 |
<listitem><para><link linkend="cgiref"><firstterm>CGI</firstterm> |
| 2362 |
programming</link>, using scripts for</para></listitem> |
| 2363 |
<listitem><para>Closing <firstterm>limit string</firstterm> |
| 2364 |
in a <firstterm>here document</firstterm>, |
| 2365 |
<link linkend="indentedls">indenting</link></para></listitem> |
| 2366 |
<listitem><para><link linkend="dosnewlines">DOS-type newlines |
| 2367 |
(<token>\r\n</token>)</link> crash a script</para></listitem> |
| 2368 |
<listitem><para><link |
| 2369 |
linkend="quotingbsl"><firstterm>Double-quoting</firstterm> |
| 2370 |
the <firstterm>backslash</firstterm> (<command>\</command>) |
| 2371 |
character</link></para></listitem> |
| 2372 |
<listitem><para><link linkend="evalrisk">eval</link>, risk of |
| 2373 |
using</para></listitem> |
| 2374 |
<listitem><para><link linkend="execperm">Execute permission |
| 2375 |
lacking</link> for commands within a script</para></listitem> |
| 2376 |
|
| 2377 |
<listitem><para> |
| 2378 |
<firstterm>Exit status</firstterm>, |
| 2379 |
<link linkend="gotchaexitvalanamalies">anomalous</link> |
| 2380 |
</para></listitem> |
| 2381 |
|
| 2382 |
<listitem><para> |
| 2383 |
<firstterm>Exit status</firstterm> |
| 2384 |
<link linkend="arxs1">of arithmetic expression <emphasis>not</emphasis> |
| 2385 |
equivalent to an <firstterm>error code</firstterm></link> |
| 2386 |
</para></listitem> |
| 2387 |
|
| 2388 |
<listitem><para><link |
| 2389 |
linkend="parchildprobref"><firstterm>Export</firstterm> |
| 2390 |
problem</link>, <firstterm>child</firstterm> process |
| 2391 |
to <firstterm>parent</firstterm> process</para></listitem> |
| 2392 |
<listitem><para><link linkend="lateverf">Extended |
| 2393 |
<firstterm>Bash</firstterm> features</link> not |
| 2394 |
available</para></listitem> |
| 2395 |
<listitem><para><link linkend="failquote">Failing to |
| 2396 |
<firstterm>quote</firstterm> variables</link> |
| 2397 |
within <firstterm>test</firstterm> brackets</para></listitem> |
| 2398 |
<listitem><para><link linkend="gnuref"><firstterm>GNU</firstterm> |
| 2399 |
command set</link>, in cross-platform scripts</para></listitem> |
| 2400 |
<listitem><para><firstterm>let</firstterm> misuse: |
| 2401 |
<link linkend="letbad">attempting to set string variables</link> |
| 2402 |
</para></listitem> |
| 2403 |
<listitem><para><link linkend="rvtcaution2">Multiple echo |
| 2404 |
statements</link> in a <link linkend="rvt">function whose |
| 2405 |
output is captured</link></para></listitem> |
| 2406 |
<listitem><para><link linkend="nullvar"><firstterm>null</firstterm> |
| 2407 |
variable assignment</link></para></listitem> |
| 2408 |
<listitem> |
| 2409 |
<para><link linkend="numstrcompne">Numerical and string |
| 2410 |
comparison operators</link> <emphasis>not</emphasis> |
| 2411 |
equivalent</para> |
| 2412 |
<para><link linkend="eqdif"><command>=</command> |
| 2413 |
and <command>-eq</command></link> <emphasis>not</emphasis> |
| 2414 |
interchangeable</para> |
| 2415 |
</listitem> |
| 2416 |
<listitem><para><link linkend="omitsemicolon">Omitting |
| 2417 |
terminal <firstterm>semicolon</firstterm></link>, |
| 2418 |
in a <firstterm>curly-bracketed</firstterm> <link |
| 2419 |
linkend="codeblockref">code block</link></para></listitem> |
| 2420 |
<listitem> |
| 2421 |
<para>Piping</para> |
| 2422 |
<para><link linkend="pipeloop"><firstterm>echo</firstterm> |
| 2423 |
to a loop</link></para> |
| 2424 |
<para><link linkend="badread0"><firstterm>echo</firstterm> |
| 2425 |
to <firstterm>read</firstterm></link> (however, this problem |
| 2426 |
<link linkend="goodread0">can be circumvented</link>)</para> |
| 2427 |
|
| 2428 |
<para><link linkend="ptailgrep"><firstterm>tail</firstterm> |
| 2429 |
<option>-f</option> to <firstterm>grep</firstterm></link></para> |
| 2430 |
</listitem> |
| 2431 |
<listitem><para>Preserving <firstterm>whitespace</firstterm> |
| 2432 |
within a variable, <link linkend="varsplitting">unintended |
| 2433 |
consequences</link></para></listitem> |
| 2434 |
<listitem><para><link linkend="suidscr"><firstterm>suid</firstterm> |
| 2435 |
commands inside a script</link></para></listitem> |
| 2436 |
<listitem><para><link linkend="undocf">Undocumented |
| 2437 |
<firstterm>Bash</firstterm> features</link>, |
| 2438 |
danger of</para></listitem> |
| 2439 |
<listitem><para>Updates to <firstterm>Bash</firstterm> |
| 2440 |
<link linkend="updatebreaks">breaking older |
| 2441 |
scripts</link></para></listitem> |
| 2442 |
<listitem><para><link linkend="uninitvar">Uninitialized |
| 2443 |
variables</link></para></listitem> |
| 2444 |
<listitem><para><link linkend="inappvn">Variable names</link>, |
| 2445 |
inappropriate</para></listitem> |
| 2446 |
<listitem><para><link linkend="varsubsh">Variables in a |
| 2447 |
<firstterm>subshell</firstterm></link>, <firstterm>scope</firstterm> |
| 2448 |
limited</para></listitem> |
| 2449 |
<listitem><para><link |
| 2450 |
linkend="badread0">Subshell in <firstterm>while-read</firstterm> |
| 2451 |
loop</link></para></listitem> |
| 2452 |
<listitem><para><link linkend="wsbad">Whitespace</link>, |
| 2453 |
misuse of</para></listitem> |
| 2454 |
|
| 2455 |
</itemizedlist></para> |
| 2456 |
|
| 2457 |
<!-- ********************** --> |
| 2458 |
<para>Pointers</para> |
| 2459 |
<itemizedlist> |
| 2460 |
<listitem><para><link |
| 2461 |
linkend="fdref1">and file descriptors</link></para></listitem> |
| 2462 |
<listitem><para><link |
| 2463 |
linkend="funcpointers">and functions</link></para></listitem> |
| 2464 |
<listitem><para><link linkend="irrref">and <firstterm>indirect |
| 2465 |
references</firstterm></link></para></listitem> |
| 2466 |
<listitem><para><link linkend="pointerref">and |
| 2467 |
<firstterm>variables</firstterm></link></para></listitem> |
| 2468 |
</itemizedlist> |
| 2469 |
<!-- ********************** --> |
| 2470 |
|
| 2471 |
|
| 2472 |
<para><link linkend="portabilityissues">Portability issues</link> |
| 2473 |
in shell scripting |
| 2474 |
<itemizedlist> |
| 2475 |
<listitem><para><link |
| 2476 |
linkend="setpum">Setting <firstterm>path</firstterm> |
| 2477 |
and <firstterm>umask</firstterm></link></para></listitem> |
| 2478 |
<listitem><para><link |
| 2479 |
linkend="testsuite0">A <firstterm>test suite</firstterm> |
| 2480 |
script</link> (Bash versus classic Bourne |
| 2481 |
shell)</para></listitem> |
| 2482 |
<listitem><para><link |
| 2483 |
linkend="whatisref3">Using <firstterm>whatis</firstterm></link> |
| 2484 |
</para></listitem> |
| 2485 |
</itemizedlist></para> |
| 2486 |
|
| 2487 |
<!-- *************************************************************** --> |
| 2488 |
<para><link linkend="posparamref1">Positional parameters</link> |
| 2489 |
|
| 2490 |
<itemizedlist> |
| 2491 |
<listitem><para><link |
| 2492 |
linkend="appref2"><varname>$@</varname></link>, |
| 2493 |
as <firstterm>separate</firstterm> words</para></listitem> |
| 2494 |
<listitem><para><link |
| 2495 |
linkend="appref"><varname>$*</varname></link>, |
| 2496 |
as a <firstterm>single</firstterm> word</para></listitem> |
| 2497 |
<listitem><para><link linkend="passedargs">in |
| 2498 |
functions</link></para></listitem> |
| 2499 |
</itemizedlist></para> |
| 2500 |
<!-- *************************************************************** --> |
| 2501 |
|
| 2502 |
<para><link linkend="posix2ref"><acronym>POSIX</acronym></link>, |
| 2503 |
<firstterm>Portable Operating System Interface / |
| 2504 |
UNIX</firstterm> |
| 2505 |
|
| 2506 |
<itemizedlist> |
| 2507 |
<listitem><para><link |
| 2508 |
linkend="posix3ref"><option>--posix</option> |
| 2509 |
option</link></para></listitem> |
| 2510 |
<listitem><para><link |
| 2511 |
linkend="posix3ref">1003.2 standard</link></para></listitem> |
| 2512 |
<listitem><para><link linkend="posixref">Character |
| 2513 |
classes</link></para></listitem> |
| 2514 |
</itemizedlist></para> |
| 2515 |
|
| 2516 |
|
| 2517 |
|
| 2518 |
<para><link linkend="ppidref"><varname>$PPID</varname></link>, |
| 2519 |
<firstterm>process ID</firstterm> of parent process</para> |
| 2520 |
<para><link linkend="opprecedence1">Precedence</link>, operator</para> |
| 2521 |
<para><link |
| 2522 |
linkend="prependref"><firstterm>Prepending</firstterm></link> |
| 2523 |
lines at head of a file, <firstterm>script |
| 2524 |
example</firstterm></para> |
| 2525 |
|
| 2526 |
|
| 2527 |
<para>Prime numbers |
| 2528 |
<itemizedlist> |
| 2529 |
<listitem><para>Generating primes |
| 2530 |
<link linkend="primes2">using the <firstterm>factor</firstterm> |
| 2531 |
command</link></para></listitem> |
| 2532 |
<listitem><para>Generating primes |
| 2533 |
<link linkend="primes1">using the <firstterm>modulo</firstterm> |
| 2534 |
operator</link></para></listitem> |
| 2535 |
<listitem><para>Sieve of Eratosthenes, <link |
| 2536 |
linkend="primes0">example script</link></para></listitem> |
| 2537 |
</itemizedlist></para> |
| 2538 |
|
| 2539 |
<para><link linkend="printfref">printf</link>, |
| 2540 |
<firstterm>formatted print</firstterm> command</para> |
| 2541 |
<para><link linkend="procref2"><filename |
| 2542 |
class="directory">/proc</filename></link> directory |
| 2543 |
<itemizedlist> |
| 2544 |
<listitem><para><link linkend="procrunning">Running processes</link>, |
| 2545 |
files describing</para></listitem> |
| 2546 |
<listitem><para><link linkend="procwarning">Writing to |
| 2547 |
files in <filename class="directory">/proc</filename></link>, |
| 2548 |
<emphasis>warning</emphasis></para></listitem> |
| 2549 |
</itemizedlist></para> |
| 2550 |
|
| 2551 |
<!-- *************************************************************** --> |
| 2552 |
<para><link linkend="processref">Process</link> |
| 2553 |
<itemizedlist> |
| 2554 |
<listitem><para><link linkend="childref2">Child |
| 2555 |
process</link></para></listitem> |
| 2556 |
<listitem><para><link linkend="parentref">Parent |
| 2557 |
process</link></para></listitem> |
| 2558 |
<listitem><para><link linkend="processiddef">Process |
| 2559 |
ID</link> (PID)</para></listitem> |
| 2560 |
</itemizedlist></para> |
| 2561 |
<!-- *************************************************************** --> |
| 2562 |
|
| 2563 |
<para><link linkend="processsubref">Process substitution</link> |
| 2564 |
<itemizedlist> |
| 2565 |
<listitem><para><link |
| 2566 |
linkend="pcc2dir">To compare contents of |
| 2567 |
directories</link></para></listitem> |
| 2568 |
<listitem><para><link |
| 2569 |
linkend="psfdstdin">To supply <filename>stdin</filename> of a |
| 2570 |
command</link></para></listitem> |
| 2571 |
<listitem><para><link |
| 2572 |
linkend="commandsparens1">Template</link></para></listitem> |
| 2573 |
<listitem><para><link |
| 2574 |
linkend="goodread0"><firstterm>while-read</firstterm> loop |
| 2575 |
without a |
| 2576 |
<firstterm>subshell</firstterm></link></para></listitem> |
| 2577 |
</itemizedlist></para> |
| 2578 |
<!-- *************************************************************** --> |
| 2579 |
<para><link linkend="tabexpansion">Programmable completion</link> |
| 2580 |
(tab expansion)</para> |
| 2581 |
<para>Prompt |
| 2582 |
|
| 2583 |
<itemizedlist> |
| 2584 |
|
| 2585 |
<listitem><para><link |
| 2586 |
linkend="ps1ref"><varname>$PS1</varname></link>, <firstterm>Main |
| 2587 |
prompt</firstterm>, seen at command |
| 2588 |
line</para></listitem> |
| 2589 |
|
| 2590 |
<listitem><para><link linkend="secpromptref"><varname>$PS2</varname></link>, |
| 2591 |
Secondary prompt</para></listitem> |
| 2592 |
</itemizedlist></para> |
| 2593 |
<!-- *************************************************************** --> |
| 2594 |
|
| 2595 |
<para><link linkend="pseudocoderef">Pseudo-code</link>, |
| 2596 |
as problem-solving method</para> |
| 2597 |
<para><link linkend="pwdref"><varname>$PWD</varname></link>, |
| 2598 |
Current working directory</para> |
| 2599 |
|
| 2600 |
<para>* * *</para> |
| 2601 |
|
| 2602 |
<para><link linkend="qky">Quackey</link>, a |
| 2603 |
<emphasis>Perquackey</emphasis>-type anagramming game (script)</para> |
| 2604 |
|
| 2605 |
<para>Question mark, <command>? </command> |
| 2606 |
<itemizedlist> |
| 2607 |
<listitem><para><link linkend="quexregex">Character |
| 2608 |
match</link> in an Extended <firstterm>Regular |
| 2609 |
Expression</firstterm></para></listitem> |
| 2610 |
<listitem><para><link linkend="quexwc">Single-character |
| 2611 |
<firstterm>wild card</firstterm></link>, |
| 2612 |
in <link |
| 2613 |
linkend="globbingref">globbing</link></para></listitem> |
| 2614 |
<listitem><para>In a |
| 2615 |
<link linkend="cstrinary"><firstterm>C</firstterm>-style |
| 2616 |
Trinary (ternary) operator</link></para></listitem> |
| 2617 |
</itemizedlist></para> |
| 2618 |
|
| 2619 |
<!-- *************************************************************** --> |
| 2620 |
<para><link linkend="quotingdef">Quoting</link> |
| 2621 |
<itemizedlist> |
| 2622 |
|
| 2623 |
<listitem><para><link linkend="quotingref">Character |
| 2624 |
string</link></para></listitem> |
| 2625 |
|
| 2626 |
<listitem><para><link |
| 2627 |
linkend="quotingvar">Variables</link></para> |
| 2628 |
<para><link |
| 2629 |
linkend="failquote">within <firstterm>test</firstterm> |
| 2630 |
brackets</link></para></listitem> |
| 2631 |
|
| 2632 |
<listitem><para><link |
| 2633 |
linkend="wsquo"><firstterm>Whitespace</firstterm></link>, |
| 2634 |
using <firstterm>quoting</firstterm> to |
| 2635 |
preserve</para></listitem> |
| 2636 |
|
| 2637 |
</itemizedlist></para> |
| 2638 |
<!-- *************************************************************** --> |
| 2639 |
|
| 2640 |
<para>* * *</para> |
| 2641 |
|
| 2642 |
<!-- *************************************************************** --> |
| 2643 |
<para>Random numbers |
| 2644 |
|
| 2645 |
<itemizedlist> |
| 2646 |
|
| 2647 |
<listitem><para><link |
| 2648 |
linkend="urandomref"><filename>/dev/urandom</filename></link> |
| 2649 |
</para></listitem> |
| 2650 |
|
| 2651 |
<listitem><para><link linkend="awkrandomref"> |
| 2652 |
<varname>rand()</varname></link>, |
| 2653 |
random function in <link |
| 2654 |
linkend="awkref">awk</link></para></listitem> |
| 2655 |
|
| 2656 |
<listitem><para><link |
| 2657 |
linkend="randomvar01"><varname>$RANDOM</varname></link>, Bash |
| 2658 |
function that returns a pseudorandom integer</para></listitem> |
| 2659 |
|
| 2660 |
<listitem><para><link linkend="daterandref">Random sequence |
| 2661 |
generation</link>, using <link linkend="dateref">date</link> |
| 2662 |
command</para></listitem> |
| 2663 |
<listitem><para><link linkend="jotrandom">Random sequence |
| 2664 |
generation</link>, using <link |
| 2665 |
linkend="jotref">jot</link></para></listitem> |
| 2666 |
|
| 2667 |
<listitem><para><link linkend="randstring0">Random string</link>, |
| 2668 |
generating</para></listitem> |
| 2669 |
|
| 2670 |
</itemizedlist></para> |
| 2671 |
|
| 2672 |
<!-- *************************************************************** --> |
| 2673 |
<para>Raspberry Pi (single-board computer) |
| 2674 |
|
| 2675 |
<itemizedlist> |
| 2676 |
|
| 2677 |
<listitem><para><link |
| 2678 |
linkend="rpsdcard01">Script for preparing a bootable SD card</link> |
| 2679 |
</para></listitem> |
| 2680 |
|
| 2681 |
</itemizedlist></para> |
| 2682 |
<!-- *************************************************************** --> |
| 2683 |
|
| 2684 |
|
| 2685 |
|
| 2686 |
<para><link linkend="rcsref">rcs</link></para> |
| 2687 |
|
| 2688 |
<!-- *************************************************************** --> |
| 2689 |
|
| 2690 |
<para><link linkend="readref">read</link>, set value of a |
| 2691 |
variable from <link |
| 2692 |
linkend="stdinoutdef"><filename>stdin</filename></link> |
| 2693 |
<itemizedlist> |
| 2694 |
|
| 2695 |
<listitem><para><link linkend="readarrow">Detecting |
| 2696 |
<firstterm>arrow</firstterm> keys</link></para></listitem> |
| 2697 |
<listitem><para><link |
| 2698 |
linkend="readoptions">Options</link></para></listitem> |
| 2699 |
<listitem><para><link linkend="readpiperef">Piping |
| 2700 |
output of <firstterm>cat</firstterm></link> |
| 2701 |
to <firstterm>read</firstterm></para></listitem> |
| 2702 |
<listitem><para><link linkend="hsread"><quote>Prepending</quote> |
| 2703 |
text</link></para></listitem> |
| 2704 |
<listitem><para><link linkend="badread0"> |
| 2705 |
Problems piping <firstterm>echo</firstterm></link> |
| 2706 |
to <firstterm>read</firstterm></para></listitem> |
| 2707 |
<listitem><para><link linkend="readredir0">Redirection from a |
| 2708 |
file</link> to <firstterm>read</firstterm></para></listitem> |
| 2709 |
<listitem><para><link |
| 2710 |
linkend="replyref"><varname>$REPLY</varname></link>, |
| 2711 |
default <firstterm>read</firstterm> variable</para></listitem> |
| 2712 |
<listitem><para><link linkend="readtimed">Timed |
| 2713 |
input</link></para></listitem> |
| 2714 |
<listitem><para><link linkend="whilereadref2"> |
| 2715 |
<firstterm>while read</firstterm></link> |
| 2716 |
construct</para></listitem> |
| 2717 |
</itemizedlist></para> |
| 2718 |
|
| 2719 |
<para><link linkend="readlineref">readline</link> library</para> |
| 2720 |
|
| 2721 |
<para><link linkend="recursionref">Recursion</link> |
| 2722 |
<itemizedlist> |
| 2723 |
<listitem><para><link |
| 2724 |
linkend="recursiondemo0">Demonstration of</link></para></listitem> |
| 2725 |
<listitem><para><link |
| 2726 |
linkend="factorialref">Factorial</link></para></listitem> |
| 2727 |
<listitem><para><link linkend="fiboref">Fibonacci |
| 2728 |
sequence</link></para></listitem> |
| 2729 |
<listitem><para><link linkend="locvarrecur">Local |
| 2730 |
variables</link></para></listitem> |
| 2731 |
<listitem><para><link linkend="scriptrecursion">Script |
| 2732 |
calling itself recursively</link></para></listitem> |
| 2733 |
<listitem><para><link linkend="hanoiref">Towers |
| 2734 |
of Hanoi</link></para></listitem> |
| 2735 |
</itemizedlist></para> |
| 2736 |
|
| 2737 |
|
| 2738 |
<!-- *************************************************************** --> |
| 2739 |
<para>Redirection |
| 2740 |
<itemizedlist> |
| 2741 |
|
| 2742 |
<listitem><para><link linkend="redirref">Code |
| 2743 |
blocks</link></para></listitem> |
| 2744 |
<listitem><para><link linkend="usingexecref">exec |
| 2745 |
<<filename>filename</filename></link>,</para> |
| 2746 |
<para>to reassign |
| 2747 |
<link linkend="fdref">file descriptors</link></para></listitem> |
| 2748 |
<listitem><para><link linkend="ioredirintro">Introductory-level |
| 2749 |
explanation</link> of <firstterm>I/O |
| 2750 |
redirection</firstterm></para></listitem> |
| 2751 |
<listitem><para><link linkend="ioredirectionref2"> |
| 2752 |
Open a file</link> for <emphasis>both</emphasis> |
| 2753 |
reading and writing</para> |
| 2754 |
<para><filename><>filename</filename> |
| 2755 |
</para></listitem> |
| 2756 |
<listitem><para><link |
| 2757 |
linkend="readredir0"><firstterm>read</firstterm> |
| 2758 |
input redirected</link> from a file</para></listitem> |
| 2759 |
<listitem><para> |
| 2760 |
<link linkend="ioredirectionref1"> |
| 2761 |
<filename>stderr</filename> to |
| 2762 |
<filename>stdout</filename></link></para> |
| 2763 |
<para><filename>2>&1 </filename></para></listitem> |
| 2764 |
|
| 2765 |
<listitem><para><link linkend="coxex"><filename>stdin</filename> / |
| 2766 |
<filename>stdout</filename></link>, |
| 2767 |
using <command> - </command></para></listitem> |
| 2768 |
<listitem><para><link linkend="redstdinfunc1"> |
| 2769 |
<filename>stdin</filename>of a |
| 2770 |
<firstterm>function</firstterm></link></para></listitem> |
| 2771 |
<listitem><para><link linkend="ioredirectionref"> |
| 2772 |
<filename>stdout</filename> to a file</link></para> |
| 2773 |
<para><replaceable>></replaceable> ... <replaceable>>></replaceable> |
| 2774 |
</para></listitem> |
| 2775 |
|
| 2776 |
<listitem><para> |
| 2777 |
<link linkend="ioredirectionref1"> |
| 2778 |
<filename>stdout</filename> to |
| 2779 |
<firstterm>file descriptor</firstterm></link> |
| 2780 |
<firstterm>j</firstterm></para> |
| 2781 |
<para><filename>>&j </filename></para></listitem> |
| 2782 |
<listitem><para> |
| 2783 |
<link linkend="ioredirectionref1"> |
| 2784 |
file descriptor<filename>i</filename> to |
| 2785 |
<firstterm>file descriptor</firstterm></link> |
| 2786 |
<firstterm>j</firstterm></para> |
| 2787 |
<para><filename>i>&j </filename></para></listitem> |
| 2788 |
|
| 2789 |
<listitem><para> |
| 2790 |
<link linkend="redirouterror2"><filename>stdout</filename> |
| 2791 |
of a command</link> to <filename>stderr</filename></para> |
| 2792 |
<para><filename>>&2</filename></para></listitem> |
| 2793 |
<listitem><para> |
| 2794 |
<link linkend="redirouterror"><filename>stdout</filename> |
| 2795 |
<emphasis>and</emphasis> <filename>stderr</filename> |
| 2796 |
of a command</link> to a file</para> |
| 2797 |
<para><filename>&> </filename></para></listitem> |
| 2798 |
<listitem><para> |
| 2799 |
<link linkend="teeref">tee</link>, redirect to a file |
| 2800 |
output of command(s) partway through a <link |
| 2801 |
linkend="piperef">pipe</link></para></listitem> |
| 2802 |
|
| 2803 |
</itemizedlist></para> |
| 2804 |
<!-- *************************************************************** --> |
| 2805 |
|
| 2806 |
<para><link linkend="refcards">Reference Cards</link> |
| 2807 |
<itemizedlist> |
| 2808 |
<listitem><para><link linkend="misctab">Miscellaneous |
| 2809 |
constructs</link></para></listitem> |
| 2810 |
<listitem><para><link linkend="parsubtab">Parameter |
| 2811 |
substitution/expansion</link></para></listitem> |
| 2812 |
<listitem><para><link linkend="specshvartab">Special shell |
| 2813 |
variables</link></para></listitem> |
| 2814 |
<listitem><para><link linkend="stringopstab">String |
| 2815 |
operations</link></para></listitem> |
| 2816 |
<listitem><para>Test operators</para> |
| 2817 |
<para><link linkend="bincomptab">Binary comparison</link></para> |
| 2818 |
<para><link linkend="filestab">Files</link></para> |
| 2819 |
</listitem> |
| 2820 |
</itemizedlist></para> |
| 2821 |
|
| 2822 |
<!-- *************************************************************** --> |
| 2823 |
|
| 2824 |
<para><link linkend="regexref"><firstterm>Regular |
| 2825 |
Expressions</firstterm></link> |
| 2826 |
<itemizedlist> |
| 2827 |
<listitem><para><command>^ </command> (caret) |
| 2828 |
<link linkend="beglineref">Beginning-of-line</link> |
| 2829 |
</para></listitem> |
| 2830 |
<listitem><para><command>$ </command> (dollar sign) |
| 2831 |
<link linkend="dollarsignref"><firstterm>Anchor</firstterm></link> |
| 2832 |
</para></listitem> |
| 2833 |
<listitem><para><command>. </command> (dot) |
| 2834 |
<link linkend="regexdot">Match single |
| 2835 |
character</link></para></listitem> |
| 2836 |
<listitem><para><command>* </command> (asterisk) |
| 2837 |
<link linkend="asteriskref2">Any number of |
| 2838 |
characters</link></para></listitem> |
| 2839 |
<listitem><para><command>[ ]</command> (brackets) <link |
| 2840 |
linkend="bracketsref">Enclose character set |
| 2841 |
to match</link></para></listitem> |
| 2842 |
<listitem><para><command>\ </command> (backslash) <link |
| 2843 |
linkend="regexbs">Escape</link>, interpret following |
| 2844 |
character literally</para></listitem> |
| 2845 |
<listitem><para><command>\< ... \> </command> |
| 2846 |
(angle brackets, <firstterm>escaped</firstterm>) |
| 2847 |
<link linkend="anglebrac">Word boundary</link></para></listitem> |
| 2848 |
<listitem> |
| 2849 |
<para><link linkend="extregex">Extended</link> |
| 2850 |
REs</para> |
| 2851 |
<para><command>+ </command> |
| 2852 |
<link linkend="plusref"><firstterm>Character |
| 2853 |
match</firstterm></link></para> |
| 2854 |
<para><command>\{ \} </command> <link linkend="escpcb">Escaped |
| 2855 |
<quote>curly</quote> brackets</link></para> |
| 2856 |
<para><command>[: :] </command> <link |
| 2857 |
linkend="posixref">POSIX character classes</link></para> |
| 2858 |
</listitem> |
| 2859 |
</itemizedlist></para> |
| 2860 |
|
| 2861 |
<para><link linkend="replyref"><varname>$REPLY</varname></link>, |
| 2862 |
Default value associated with <link linkend="readref">read</link> |
| 2863 |
command</para> |
| 2864 |
<para><link linkend="restrictedshref">Restricted shell</link>, |
| 2865 |
shell (or script) with certain commands disabled</para> |
| 2866 |
<para><link linkend="returnref">return</link>, |
| 2867 |
command that terminates a <link |
| 2868 |
linkend="functionref">function</link></para> |
| 2869 |
|
| 2870 |
<para><link linkend="runpartsref">run-parts</link> |
| 2871 |
<itemizedlist> |
| 2872 |
<listitem><para><link linkend="runpartsref2">Running scripts |
| 2873 |
in sequence</link>, without user intervention</para></listitem> |
| 2874 |
</itemizedlist></para> |
| 2875 |
|
| 2876 |
<para>* * *</para> |
| 2877 |
|
| 2878 |
<para><link linkend="scoperef">Scope</link> of a variable, |
| 2879 |
definition</para> |
| 2880 |
<para><link linkend="invocationoptionsref">Script options</link>, |
| 2881 |
set at command line</para> |
| 2882 |
<para><link linkend="libroutines">Scripting routines</link>, |
| 2883 |
library of useful definitions and <link |
| 2884 |
linkend="functionref">functions</link></para> |
| 2885 |
<para><link linkend="secpromptref">Secondary prompt</link>, |
| 2886 |
<command><varname>$PS2</varname></command></para> |
| 2887 |
|
| 2888 |
<para><link linkend="securityissues">Security issues</link> |
| 2889 |
<itemizedlist> |
| 2890 |
<listitem><para><link linkend="nmapref">nmap</link>, |
| 2891 |
<firstterm>network mapper</firstterm> |
| 2892 |
/ port scanner</para></listitem> |
| 2893 |
<listitem><para><link linkend="sudoref">sudo</link></para></listitem> |
| 2894 |
<listitem><para><link linkend="suidscr"><firstterm>suid</firstterm> |
| 2895 |
commands inside a script</link></para></listitem> |
| 2896 |
<listitem><para><link linkend="infectedscripts1">Viruses, |
| 2897 |
trojans, and worms</link> in scripts</para></listitem> |
| 2898 |
<listitem><para><link linkend="securitytips1">Writing |
| 2899 |
secure scripts</link></para></listitem> |
| 2900 |
</itemizedlist></para> |
| 2901 |
|
| 2902 |
|
| 2903 |
|
| 2904 |
<para><link linkend="sedref">sed</link>, |
| 2905 |
pattern-based programming language |
| 2906 |
<itemizedlist> |
| 2907 |
<listitem><para><link |
| 2908 |
linkend="sedbasictable"><command>Table</command></link>, |
| 2909 |
basic operators</para></listitem> |
| 2910 |
<listitem><para><link |
| 2911 |
linkend="sedoptable"><command>Table</command></link>, |
| 2912 |
examples of operators</para></listitem> |
| 2913 |
</itemizedlist></para> |
| 2914 |
|
| 2915 |
<para><link linkend="selectref">select</link>, |
| 2916 |
construct for menu building |
| 2917 |
<itemizedlist> |
| 2918 |
<listitem><para><link linkend="inlistomit"><userinput>in |
| 2919 |
<replaceable>list</replaceable></userinput> omitted</link> |
| 2920 |
</para></listitem> |
| 2921 |
</itemizedlist></para> |
| 2922 |
|
| 2923 |
<para><link linkend="semaphoreref">Semaphore</link></para> |
| 2924 |
|
| 2925 |
<para><link linkend="needsemicolon">Semicolon required</link>, |
| 2926 |
when <link linkend="doinref">do</link> |
| 2927 |
<firstterm>keyword</firstterm> is on first line of <link |
| 2928 |
linkend="forloopref1">loop</link> |
| 2929 |
<itemizedlist> |
| 2930 |
<listitem><para><link linkend="omitsemicolon">When |
| 2931 |
terminating <firstterm>curly-bracketed</firstterm> |
| 2932 |
code block</link></para></listitem> |
| 2933 |
</itemizedlist></para> |
| 2934 |
|
| 2935 |
<para><link linkend="seqref">seq</link>, |
| 2936 |
Emit a sequence of integers. Equivalent to <link |
| 2937 |
linkend="jotref">jot</link>.</para> |
| 2938 |
|
| 2939 |
<para><link linkend="setref">set</link>, |
| 2940 |
Change value of internal script variables |
| 2941 |
<itemizedlist> |
| 2942 |
<listitem><para><link linkend="undvarerr">set -u</link>, |
| 2943 |
Abort script with error message if attempting to use |
| 2944 |
an <firstterm>undeclared</firstterm> variable.</para></listitem> |
| 2945 |
</itemizedlist> |
| 2946 |
</para> |
| 2947 |
|
| 2948 |
<para><link linkend="whatsascript">Shell script</link>, |
| 2949 |
definition of</para> |
| 2950 |
<para><link linkend="shwrapper">Shell wrapper</link>, |
| 2951 |
script embedding a command or utility</para> |
| 2952 |
<para><link linkend="shiftref">shift</link>, reassigning |
| 2953 |
<firstterm>positional parameters</firstterm></para> |
| 2954 |
<para><link linkend="shlvlref"><varname>$SHLVL</varname></link>, |
| 2955 |
<firstterm>shell level</firstterm>, depth to which the shell |
| 2956 |
(or script) is nested</para> |
| 2957 |
<para><link linkend="shoptref">shopt</link>, |
| 2958 |
change <firstterm>shell options</firstterm></para> |
| 2959 |
<para><link linkend="signald">Signal</link>, |
| 2960 |
a message sent to a process</para> |
| 2961 |
|
| 2962 |
<para>Simulations |
| 2963 |
<itemizedlist> |
| 2964 |
<listitem><para><link linkend="brownianref">Brownian |
| 2965 |
motion</link></para></listitem> |
| 2966 |
<listitem><para><link linkend="brownianref">Galton |
| 2967 |
board</link></para></listitem> |
| 2968 |
<listitem><para><link |
| 2969 |
linkend="horseraceref">Horserace</link></para></listitem> |
| 2970 |
<listitem><para><link |
| 2971 |
linkend="liferef"><emphasis>Life</emphasis></link>, |
| 2972 |
game of</para></listitem> |
| 2973 |
<listitem><para><link linkend="cannonref">PI</link>, |
| 2974 |
approximating by firing cannonballs</para></listitem> |
| 2975 |
<listitem><para><link linkend="stackex0">Pushdown |
| 2976 |
<firstterm>stack</firstterm></link></para></listitem> |
| 2977 |
</itemizedlist></para> |
| 2978 |
|
| 2979 |
<para><link linkend="snglquo">Single quotes</link> |
| 2980 |
(<command>' ... '</command>) <firstterm>strong</firstterm> <link |
| 2981 |
linkend="quotingref">quoting</link></para> |
| 2982 |
<para><link linkend="socketref">Socket</link>, a communication |
| 2983 |
node associated with an I/O port</para> |
| 2984 |
|
| 2985 |
<para>Sorting |
| 2986 |
<itemizedlist> |
| 2987 |
<listitem><para><link linkend="bubblesort">Bubble |
| 2988 |
sort</link></para></listitem> |
| 2989 |
<listitem><para><link linkend="insertionsort0">Insertion |
| 2990 |
sort</link></para></listitem> |
| 2991 |
</itemizedlist></para> |
| 2992 |
|
| 2993 |
<para><link linkend="sourceref">source</link>, |
| 2994 |
execute a script or, within a script, import a file |
| 2995 |
<itemizedlist> |
| 2996 |
<listitem><para><link linkend="sourceparams">Passing positional |
| 2997 |
parameters</link></para></listitem> |
| 2998 |
</itemizedlist></para> |
| 2999 |
|
| 3000 |
<para><firstterm>Spam</firstterm>, dealing with |
| 3001 |
<itemizedlist> |
| 3002 |
<listitem><para><link linkend="spamlookup_0"><firstterm>Example |
| 3003 |
script</firstterm></link></para></listitem> |
| 3004 |
<listitem><para><link linkend="isspammer_0"><firstterm>Example |
| 3005 |
script</firstterm></link></para></listitem> |
| 3006 |
<listitem><para><link linkend="isspammer2_0"><firstterm>Example |
| 3007 |
script</firstterm></link></para></listitem> |
| 3008 |
<listitem><para><link linkend="whx0"><firstterm>Example |
| 3009 |
script</firstterm></link></para></listitem> |
| 3010 |
</itemizedlist></para> |
| 3011 |
|
| 3012 |
<para><link linkend="scharlist1">Special characters</link></para> |
| 3013 |
|
| 3014 |
<para>Stack |
| 3015 |
<itemizedlist> |
| 3016 |
<listitem><para><link |
| 3017 |
linkend="stackdefref">Definition</link></para></listitem> |
| 3018 |
<listitem><para>Emulating a <firstterm>push-down stack</firstterm>, |
| 3019 |
<link linkend="stackex0">example script</link></para></listitem> |
| 3020 |
</itemizedlist></para> |
| 3021 |
|
| 3022 |
<para>Standard Deviation, <link linkend="stddev">example script</link></para> |
| 3023 |
<para><link linkend="filesref1">Startup files</link>, Bash</para> |
| 3024 |
|
| 3025 |
<para><link linkend="stdinoutdef"><filename>stdin</filename> |
| 3026 |
and <filename>stdout</filename></link></para> |
| 3027 |
|
| 3028 |
<para><link linkend="stopwatch">Stopwatch</link>, |
| 3029 |
example script</para> |
| 3030 |
|
| 3031 |
<!-- *************************************************************** --> |
| 3032 |
<para>Strings |
| 3033 |
<itemizedlist> |
| 3034 |
|
| 3035 |
<listitem><para> |
| 3036 |
<command>=~ </command> |
| 3037 |
<link linkend="regexmatchref">String match operator</link> |
| 3038 |
</para></listitem> |
| 3039 |
|
| 3040 |
<listitem><para><link |
| 3041 |
linkend="scomparison1">Comparison</link></para></listitem> |
| 3042 |
<listitem><para><link linkend="psorex1">Length</link></para> |
| 3043 |
<para><replaceable>${#string}</replaceable></para></listitem> |
| 3044 |
<listitem><para><link |
| 3045 |
linkend="stringmanip">Manipulation</link></para></listitem> |
| 3046 |
<listitem><para><link linkend="awkstringmanip2">Manipulation</link>, |
| 3047 |
using <link linkend="awkref">awk</link></para></listitem> |
| 3048 |
<listitem><para><link linkend="stringnotnull"><firstterm>Null</firstterm> |
| 3049 |
string</link>, testing for</para></listitem> |
| 3050 |
<listitem> |
| 3051 |
<para><link |
| 3052 |
linkend="protectliteral0">Protecting strings</link> |
| 3053 |
from expansion and/or reinterpretation, |
| 3054 |
<firstterm>script example</firstterm></para> |
| 3055 |
<para><link |
| 3056 |
linkend="unprotectliteral0"><firstterm>Unprotecting</firstterm> |
| 3057 |
strings</link>, |
| 3058 |
<firstterm>script example</firstterm></para> |
| 3059 |
</listitem> |
| 3060 |
|
| 3061 |
<listitem> |
| 3062 |
<para><firstterm>strchr()</firstterm>, <link |
| 3063 |
linkend="substringindex2">equivalent of</link></para> |
| 3064 |
</listitem> |
| 3065 |
|
| 3066 |
<listitem> |
| 3067 |
<para><firstterm>strlen()</firstterm>, <link |
| 3068 |
linkend="strlen">equivalent of</link></para> |
| 3069 |
</listitem> |
| 3070 |
|
| 3071 |
<listitem> |
| 3072 |
<para><link linkend="stringsref">strings</link> command, |
| 3073 |
find printable strings in a binary or data file</para> |
| 3074 |
</listitem> |
| 3075 |
|
| 3076 |
<listitem> |
| 3077 |
<para>Substring extraction</para> |
| 3078 |
<para><link linkend="substrextr01">${string:position}</link></para> |
| 3079 |
<para><link |
| 3080 |
linkend="substrextr02">${string:position:length}</link></para> |
| 3081 |
<para><link linkend="expextrsub">Using |
| 3082 |
<firstterm>expr</firstterm></link> |
| 3083 |
</para></listitem> |
| 3084 |
|
| 3085 |
<listitem><para><link linkend="substringindex2">Substring |
| 3086 |
<firstterm>index</firstterm></link> (numerical position in |
| 3087 |
string)</para></listitem> |
| 3088 |
<listitem><para><link linkend="exprparen">Substring |
| 3089 |
<firstterm>matching</firstterm></link>, using |
| 3090 |
<link linkend="exprref">expr</link></para></listitem> |
| 3091 |
|
| 3092 |
<listitem> |
| 3093 |
<para><link linkend="psorex1">Substring |
| 3094 |
<firstterm>removal</firstterm></link></para> |
| 3095 |
<para><link linkend="psorexsh">${var#Pattern}</link></para> |
| 3096 |
<para><link linkend="psorexlo">${var##Pattern}</link></para> |
| 3097 |
<para><link linkend="pctrep1">${var%Pattern}</link></para> |
| 3098 |
<para><link linkend="pctrep2">${var%%Pattern}</link></para> |
| 3099 |
</listitem> |
| 3100 |
|
| 3101 |
<listitem> |
| 3102 |
<para>Substring replacement</para> |
| 3103 |
<para><link linkend="substrrepl00">${string/substring/replacement}</link></para> |
| 3104 |
<para><link linkend="substrrepl01">${string//substring/replacement}</link></para> |
| 3105 |
<para><link linkend="substrrepl02">${string/#substring/replacement}</link></para> |
| 3106 |
<para><link linkend="substrrepl03">${string/%substring/replacement}</link> |
| 3107 |
</para> |
| 3108 |
|
| 3109 |
<para><link linkend="daysbetween0"><firstterm>Script |
| 3110 |
example</firstterm></link></para> |
| 3111 |
</listitem> |
| 3112 |
|
| 3113 |
<listitem><para><link |
| 3114 |
linkend="stringopstab"><command>Table</command></link> |
| 3115 |
of <firstterm>string/substring</firstterm> manipulation and |
| 3116 |
extraction operators</para></listitem> |
| 3117 |
|
| 3118 |
</itemizedlist></para> |
| 3119 |
<!-- *************************************************************** --> |
| 3120 |
|
| 3121 |
<para><link linkend="snglquo"><firstterm>Strong</firstterm> quoting</link> |
| 3122 |
<command>' ... '</command></para> |
| 3123 |
|
| 3124 |
<para><link linkend="scrstyle">Stylesheet</link> |
| 3125 |
for writing scripts</para> |
| 3126 |
|
| 3127 |
<!-- *************************************************************** --> |
| 3128 |
<para><link linkend="subshellsref">Subshell</link> |
| 3129 |
<itemizedlist> |
| 3130 |
<listitem><para><link linkend="subshellparens1">Command list within |
| 3131 |
parentheses</link></para></listitem> |
| 3132 |
<listitem><para><link linkend="subshnlevref">Variables</link>, |
| 3133 |
<varname>$BASH_SUBSHELL</varname> and |
| 3134 |
<varname>$SHLVL</varname></para></listitem> |
| 3135 |
|
| 3136 |
<listitem> |
| 3137 |
<para>Variables in a <firstterm>subshell</firstterm></para> |
| 3138 |
|
| 3139 |
<para><link linkend="varsubsh"><firstterm>scope</firstterm> |
| 3140 |
limited</link>, but ...</para> |
| 3141 |
|
| 3142 |
<para> ... <link linkend="subshtmp">can be accessed outside |
| 3143 |
the subshell?</link> |
| 3144 |
</para> |
| 3145 |
</listitem> |
| 3146 |
|
| 3147 |
</itemizedlist></para> |
| 3148 |
<!-- *************************************************************** --> |
| 3149 |
|
| 3150 |
<para><link linkend="suref">su</link> <firstterm>Substitute |
| 3151 |
user</firstterm>, log on as a different user or as |
| 3152 |
<firstterm>root</firstterm></para> |
| 3153 |
<para><link linkend="suidref">suid</link> (<firstterm>set user |
| 3154 |
id</firstterm>) file flag |
| 3155 |
<itemizedlist> |
| 3156 |
<listitem><para><link linkend="suidscr"><firstterm>suid</firstterm> |
| 3157 |
commands inside a script</link>, not advisable</para></listitem> |
| 3158 |
</itemizedlist></para> |
| 3159 |
|
| 3160 |
<para><link linkend="symlinkref">Symbolic links</link></para> |
| 3161 |
|
| 3162 |
<para><link linkend="swapfileref">Swapfiles</link></para> |
| 3163 |
|
| 3164 |
<para>* * *</para> |
| 3165 |
|
| 3166 |
<para><link linkend="tabexpansion">Tab completion</link></para> |
| 3167 |
<para>Table lookup, <link linkend="resistor">script |
| 3168 |
example</link></para> |
| 3169 |
<para><link linkend="tailref">tail</link>, <firstterm>echo</firstterm> |
| 3170 |
to <filename>stdout</filename> lines at the (tail) end of a text |
| 3171 |
file</para> |
| 3172 |
<para><link linkend="tarref">tar</link>, archiving utility</para> |
| 3173 |
<para><link linkend="teeref">tee</link>, redirect to a file |
| 3174 |
output of command(s) partway through a <link |
| 3175 |
linkend="piperef">pipe</link></para> |
| 3176 |
|
| 3177 |
<para><link linkend="terminalssys1">Terminals</link> |
| 3178 |
<itemizedlist> |
| 3179 |
<listitem><para><link |
| 3180 |
linkend="setserialref">setserial</link></para></listitem> |
| 3181 |
<listitem><para><link |
| 3182 |
linkend="settermref">setterm</link></para></listitem> |
| 3183 |
<listitem><para><link linkend="sttyref">stty</link></para></listitem> |
| 3184 |
<listitem><para><link linkend="tputref">tput</link></para></listitem> |
| 3185 |
<listitem><para><link linkend="wallref">wall</link></para></listitem> |
| 3186 |
</itemizedlist></para> |
| 3187 |
|
| 3188 |
<para><firstterm>test</firstterm> command |
| 3189 |
<itemizedlist> |
| 3190 |
<listitem><para><link linkend="ttestref">Bash |
| 3191 |
<firstterm>builtin</firstterm></link></para></listitem> |
| 3192 |
<listitem><para><link linkend="usrbintest">external |
| 3193 |
command</link>, <filename>/usr/bin/test</filename> |
| 3194 |
(equivalent to <filename>/usr/bin/[</filename>)</para></listitem> |
| 3195 |
</itemizedlist></para> |
| 3196 |
|
| 3197 |
<para><link linkend="testconstructs1">Test constructs</link></para> |
| 3198 |
|
| 3199 |
<!-- *************************************************************** --> |
| 3200 |
<para>Test operators |
| 3201 |
<itemizedlist> |
| 3202 |
|
| 3203 |
<listitem><para><command>-a </command> |
| 3204 |
<link linkend="compoundand">Logical AND</link> |
| 3205 |
compound comparison</para></listitem> |
| 3206 |
<listitem><para><command>-e </command> |
| 3207 |
<link linkend="rtif">File exists</link></para></listitem> |
| 3208 |
<listitem><para><command>-eq </command> |
| 3209 |
<link linkend="equalref">is-equal-to</link> (integer |
| 3210 |
comparison)</para></listitem> |
| 3211 |
<listitem><para><command>-f </command> |
| 3212 |
<link linkend="regularfile">File is a <firstterm>regular</firstterm> |
| 3213 |
file</link></para></listitem> |
| 3214 |
<listitem><para><command>-ge </command> |
| 3215 |
<link linkend="ge0ref">greater-than or equal</link> |
| 3216 |
(integer comparison)</para></listitem> |
| 3217 |
<listitem><para><command>-gt </command> |
| 3218 |
<link linkend="gt0ref">greater-than</link> (integer |
| 3219 |
comparison)</para></listitem> |
| 3220 |
<listitem><para><command>-le </command> |
| 3221 |
<link linkend="le0ref">less-than or equal</link> |
| 3222 |
(integer comparison)</para></listitem> |
| 3223 |
<listitem><para><command>-lt </command> |
| 3224 |
<link linkend="lt0ref">less-than</link> |
| 3225 |
(integer comparison)</para></listitem> |
| 3226 |
<listitem><para><command>-n </command> |
| 3227 |
<link linkend="stringnotnull">not-zero-length</link> |
| 3228 |
(string comparison)</para></listitem> |
| 3229 |
<listitem><para><command>-ne </command> |
| 3230 |
<link linkend="nequalref">not-equal-to</link> |
| 3231 |
(integer comparison)</para></listitem> |
| 3232 |
<listitem><para><command>-o </command> |
| 3233 |
<link linkend="compoundor">Logical OR</link> |
| 3234 |
compound comparison</para></listitem> |
| 3235 |
<listitem><para><command>-u </command> |
| 3236 |
<link linkend="suidref"><firstterm>suid</firstterm> |
| 3237 |
flag set</link>, file test</para></listitem> |
| 3238 |
<listitem><para><command>-z </command> |
| 3239 |
<link linkend="stringnull">is-zero-length</link> |
| 3240 |
(string comparison)</para></listitem> |
| 3241 |
|
| 3242 |
<listitem><para><command>= </command> |
| 3243 |
<link linkend="scomparison1">is-equal-to</link> |
| 3244 |
(string comparison)</para> |
| 3245 |
<para><command>== </command> |
| 3246 |
<link linkend="scomparison2">is-equal-to</link> |
| 3247 |
(string comparison)</para></listitem> |
| 3248 |
<listitem><para> <command>< </command> |
| 3249 |
<link linkend="ltref">less-than</link> |
| 3250 |
(string comparison)</para></listitem> |
| 3251 |
<listitem><para><command>< </command> |
| 3252 |
<link linkend="intlt">less-than</link>, |
| 3253 |
(integer comparison, within |
| 3254 |
<link linkend="dblparens">double parentheses</link>) |
| 3255 |
</para></listitem> |
| 3256 |
<listitem><para><command><= </command> |
| 3257 |
<link linkend="lteq">less-than-or-equal</link>, |
| 3258 |
(integer comparison, within |
| 3259 |
<firstterm>double parentheses</firstterm>) |
| 3260 |
</para></listitem> |
| 3261 |
<listitem><para><command>> </command> |
| 3262 |
<link linkend="gtref">greater-than</link> |
| 3263 |
(string comparison)</para></listitem> |
| 3264 |
<listitem><para><command>> </command> |
| 3265 |
<link linkend="intgt">greater-than</link>, |
| 3266 |
(integer comparison, within |
| 3267 |
<firstterm>double parentheses</firstterm>)</para></listitem> |
| 3268 |
<listitem><para><command>>= </command> |
| 3269 |
<link linkend="gteq">greater-than-or-equal</link>, |
| 3270 |
(integer comparison, within |
| 3271 |
<firstterm>double parentheses</firstterm>) |
| 3272 |
</para></listitem> |
| 3273 |
<listitem><para><command>|| </command> |
| 3274 |
<link linkend="orref">Logical OR </link></para></listitem> |
| 3275 |
<listitem><para><command>&& </command> |
| 3276 |
<link linkend="logicaland">Logical AND</link></para></listitem> |
| 3277 |
|
| 3278 |
<listitem><para><command>! </command> |
| 3279 |
<link linkend="notref">Negation operator</link>, inverts <link |
| 3280 |
linkend="exitstatusref">exit status</link> of a |
| 3281 |
test</para> |
| 3282 |
<para><command>!= </command> |
| 3283 |
<link linkend="notequal">not-equal-to</link> |
| 3284 |
(string comparison)</para></listitem> |
| 3285 |
|
| 3286 |
<listitem> |
| 3287 |
<para><command>Tables</command> of <firstterm>test</firstterm> |
| 3288 |
operators</para> |
| 3289 |
<para><link linkend="bincomptab">Binary comparison</link></para> |
| 3290 |
<para><link linkend="filestab">File</link></para> |
| 3291 |
</listitem> |
| 3292 |
|
| 3293 |
</itemizedlist></para> |
| 3294 |
<!-- *************************************************************** --> |
| 3295 |
|
| 3296 |
<para><link linkend="textproc">Text and text file |
| 3297 |
processing</link></para> |
| 3298 |
<para><link linkend="timedate">Time / Date</link></para> |
| 3299 |
|
| 3300 |
<!-- *************************************************************** --> |
| 3301 |
<para>Timed input |
| 3302 |
<itemizedlist> |
| 3303 |
<listitem><para><link linkend="readtimed">Using |
| 3304 |
<firstterm>read -t</firstterm></link></para></listitem> |
| 3305 |
<listitem><para><link linkend="sttyto">Using |
| 3306 |
<firstterm>stty</firstterm></link></para></listitem> |
| 3307 |
<listitem><para><link linkend="timingloop">Using |
| 3308 |
timing loop</link></para></listitem> |
| 3309 |
<listitem><para><link linkend="tmoutref">Using |
| 3310 |
<varname>$TMOUT</varname></link></para></listitem> |
| 3311 |
|
| 3312 |
</itemizedlist></para> |
| 3313 |
|
| 3314 |
<!-- *************************************************************** --> |
| 3315 |
<para><link linkend="assortedtips">Tips and hints</link> |
| 3316 |
for Bash scripts |
| 3317 |
<itemizedlist> |
| 3318 |
|
| 3319 |
<listitem><para>Array, <link linkend="retarray">as |
| 3320 |
<firstterm>return value</firstterm> from |
| 3321 |
a function</link></para> |
| 3322 |
<para><firstterm>Associative</firstterm> array |
| 3323 |
<link linkend="assocarrtst">more efficient</link> |
| 3324 |
than a numerically-indexed array</para></listitem> |
| 3325 |
|
| 3326 |
<listitem><para><link linkend="captureretval">Capturing |
| 3327 |
the return value</link> of a function, using |
| 3328 |
<firstterm>echo</firstterm></para></listitem> |
| 3329 |
|
| 3330 |
<listitem><para><link linkend="cgiscript"><firstterm>CGI</firstterm> |
| 3331 |
programming</link>, using scripts for</para></listitem> |
| 3332 |
|
| 3333 |
<listitem> |
| 3334 |
<para>Comment blocks</para> |
| 3335 |
<para>Using <link linkend="cblock1"><firstterm>anonymous |
| 3336 |
here documents</firstterm></link></para> |
| 3337 |
<para>Using <link linkend="comoutbl"> <firstterm>if-then</firstterm> |
| 3338 |
constructs</link></para> |
| 3339 |
</listitem> |
| 3340 |
|
| 3341 |
<listitem><para><link linkend="commenth">Comment headers</link>, |
| 3342 |
special purpose</para></listitem> |
| 3343 |
<listitem><para><link |
| 3344 |
linkend="cstyle"><firstterm>C</firstterm>-style syntax </link>, |
| 3345 |
for manipulating variables</para></listitem> |
| 3346 |
|
| 3347 |
<listitem><para><link linkend="doublespace">Double-spacing a text |
| 3348 |
file</link></para></listitem> |
| 3349 |
|
| 3350 |
<listitem><para>Filenames prefixed with a dash, |
| 3351 |
<link linkend="dashrem">removing</link></para></listitem> |
| 3352 |
|
| 3353 |
<listitem><para><link linkend="filteroutp">Filter</link>, |
| 3354 |
feeding output back to <emphasis>same</emphasis> |
| 3355 |
filter</para></listitem> |
| 3356 |
<listitem><para>Function<link linkend="rvt"> |
| 3357 |
<firstterm>return</firstterm> value |
| 3358 |
workarounds</link></para></listitem> |
| 3359 |
<listitem><para><link linkend="ifgrepfix"><firstterm>if-grep</firstterm> |
| 3360 |
test fixup</link></para></listitem> |
| 3361 |
<listitem><para><link linkend="libroutines">Library</link> |
| 3362 |
of useful definitions and |
| 3363 |
<firstterm>functions</firstterm></para></listitem> |
| 3364 |
<listitem><para><link linkend="nullvar"><firstterm>null</firstterm> |
| 3365 |
variable assignment</link>, avoiding</para></listitem> |
| 3366 |
<listitem><para><link linkend="passarray">Passing |
| 3367 |
an <firstterm>array</firstterm></link> to a |
| 3368 |
function</para></listitem> |
| 3369 |
<listitem><para><varname>$PATH</varname>, |
| 3370 |
appending to, <link linkend="pathappend">using the |
| 3371 |
<varname>+=</varname> operator</link>.</para></listitem> |
| 3372 |
<listitem><para><link |
| 3373 |
linkend="prependref"><firstterm>Prepending</firstterm></link> |
| 3374 |
lines at head of a file</para></listitem> |
| 3375 |
<listitem><para><link linkend="progressbar">Progress |
| 3376 |
bar</link> template</para></listitem> |
| 3377 |
<listitem><para><link |
| 3378 |
linkend="pseudocoderef">Pseudo-code</link></para></listitem> |
| 3379 |
<listitem><para><link linkend="rcsref">rcs</link></para></listitem> |
| 3380 |
<listitem><para><link |
| 3381 |
linkend="devnullredirect">Redirecting a <firstterm>test</firstterm> |
| 3382 |
to <filename>/dev/null</filename</link> to suppress output</para></listitem> |
| 3383 |
<listitem><para><link linkend="runpartsref2">Running scripts in |
| 3384 |
sequence</link> without user intervention, using <link |
| 3385 |
linkend="runpartsref">run-parts</link></para></listitem> |
| 3386 |
<listitem><para>Script<link linkend="scriptasemb"> as embedded |
| 3387 |
command</link></para></listitem> |
| 3388 |
<listitem> |
| 3389 |
<para>Script <firstterm>portability</firstterm></para> |
| 3390 |
<para><link |
| 3391 |
linkend="setpum">Setting <firstterm>path</firstterm> |
| 3392 |
and <firstterm>umask</firstterm></link></para> |
| 3393 |
<para><link |
| 3394 |
linkend="whatisref3">Using <firstterm>whatis</firstterm></link> |
| 3395 |
</para> |
| 3396 |
</listitem> |
| 3397 |
|
| 3398 |
<listitem><para><link |
| 3399 |
linkend="setvaremb">Setting script variable</link> |
| 3400 |
to a block of embedded <firstterm>sed</firstterm> or |
| 3401 |
<firstterm>awk</firstterm> code</para></listitem> |
| 3402 |
<listitem><para>Speeding up script execution by <link |
| 3403 |
linkend="lcall">disabling <firstterm>unicode</firstterm></link> |
| 3404 |
</para></listitem> |
| 3405 |
<listitem><para>Subshell variable, |
| 3406 |
<link linkend="subshtmp">accessing outside the subshell</link> |
| 3407 |
</para></listitem> |
| 3408 |
<listitem><para><link linkend="intparam">Testing a variable</link> |
| 3409 |
to see if it contains only digits</para></listitem> |
| 3410 |
<listitem><para><link linkend="devnullredirect">Testing whether |
| 3411 |
a command exists</link>, using <link |
| 3412 |
linkend="typeref">type</link></para></listitem> |
| 3413 |
<listitem><para><link |
| 3414 |
linkend="trackingscr">Tracking script |
| 3415 |
usage</link></para></listitem> |
| 3416 |
<listitem><para><link |
| 3417 |
linkend="goodread0"><firstterm>while-read</firstterm> loop |
| 3418 |
without a |
| 3419 |
<firstterm>subshell</firstterm></link></para></listitem> |
| 3420 |
<listitem><para><link |
| 3421 |
linkend="widgetref">Widgets</link>, invoking from a |
| 3422 |
script</para></listitem> |
| 3423 |
|
| 3424 |
</itemizedlist></para> |
| 3425 |
|
| 3426 |
|
| 3427 |
<para><link linkend="tmoutref"><varname>$TMOUT</varname></link>, |
| 3428 |
Timeout interval</para> |
| 3429 |
<para><link linkend="tokenref">Token</link>, a symbol that may |
| 3430 |
expand to a <link linkend="keywordref">keyword</link> or |
| 3431 |
command</para> |
| 3432 |
<para><link linkend="tputref">tput</link>, terminal-control |
| 3433 |
command</para> |
| 3434 |
|
| 3435 |
<para><link linkend="trref">tr</link>, character translation filter |
| 3436 |
<itemizedlist> |
| 3437 |
<listitem><para><link |
| 3438 |
linkend="trd2u">DOS to Unix text file |
| 3439 |
conversion</link></para></listitem> |
| 3440 |
<listitem><para><link linkend="troptions">Options</link></para></listitem> |
| 3441 |
<listitem><para><link |
| 3442 |
linkend="soundex0">Soundex</link>, <firstterm>example |
| 3443 |
script</firstterm></para></listitem> |
| 3444 |
<listitem><para><link |
| 3445 |
linkend="trvariants">Variants</link></para></listitem> |
| 3446 |
</itemizedlist></para> |
| 3447 |
|
| 3448 |
<para><link linkend="trapref1"><firstterm>Trap</firstterm></link>, |
| 3449 |
specifying an action upon receipt of a <link |
| 3450 |
linkend="signald">signal</link></para> |
| 3451 |
|
| 3452 |
<para><firstterm>Trinary (ternary)</firstterm> operator, |
| 3453 |
<firstterm>C</firstterm>-style, |
| 3454 |
<userinput>var>10?88:99</userinput> |
| 3455 |
<itemizedlist> |
| 3456 |
<listitem><para><link linkend="cstrinary">in |
| 3457 |
<firstterm>double-parentheses</firstterm> |
| 3458 |
construct</link></para></listitem> |
| 3459 |
<listitem><para><link linkend="ex46">in <firstterm>let</firstterm> |
| 3460 |
construct</link></para></listitem> |
| 3461 |
</itemizedlist></para> |
| 3462 |
|
| 3463 |
<para><link linkend="trueref">true</link>, |
| 3464 |
returns <firstterm>successful</firstterm> (0) <link |
| 3465 |
linkend="exitstatusref">exit status</link></para> |
| 3466 |
<para><link linkend="declare1ref">typeset</link> builtin |
| 3467 |
<itemizedlist> |
| 3468 |
<listitem><para><link |
| 3469 |
linkend="declareopsref1">options</link></para></listitem> |
| 3470 |
</itemizedlist></para> |
| 3471 |
|
| 3472 |
<para>* * *</para> |
| 3473 |
|
| 3474 |
<para><link linkend="uidref"><varname>$UID</varname></link>, |
| 3475 |
User ID number</para> |
| 3476 |
<para><link linkend="unaliasref">unalias</link>, |
| 3477 |
to remove an <link linkend="aliasref">alias</link></para> |
| 3478 |
<para><link linkend="unameref">uname</link>, |
| 3479 |
output system information</para> |
| 3480 |
<para><link linkend="unicoderef">Unicode</link>, encoding standard |
| 3481 |
for representing letters and symbols |
| 3482 |
<itemizedlist> |
| 3483 |
<listitem><para><link |
| 3484 |
linkend="lcall">Disabling <firstterm>unicode</firstterm></link> |
| 3485 |
to optimize script</para></listitem> |
| 3486 |
</itemizedlist></para> |
| 3487 |
|
| 3488 |
|
| 3489 |
<para><link linkend="uninitvar">Uninitialized variables</link> </para> |
| 3490 |
<para><link linkend="uniqref">uniq</link>, |
| 3491 |
filter to remove duplicate lines from a sorted file</para> |
| 3492 |
<para><link linkend="unsetref">unset</link>, |
| 3493 |
delete a shell variable</para> |
| 3494 |
<para><link linkend="untilloopref">until</link> loop</para> |
| 3495 |
<para><firstterm>until [ condition-is-true ]; do</firstterm></para> |
| 3496 |
|
| 3497 |
<para>* * *</para> |
| 3498 |
|
| 3499 |
<para><firstterm>Variables</firstterm> |
| 3500 |
|
| 3501 |
<itemizedlist> |
| 3502 |
|
| 3503 |
<listitem><para><link linkend="arrayopsvars">Array operations on |
| 3504 |
</link></para></listitem> |
| 3505 |
<listitem> |
| 3506 |
<para><link |
| 3507 |
linkend="asnop1">Assignment</link></para> |
| 3508 |
<para><link |
| 3509 |
linkend="ex15_0"><firstterm>Script |
| 3510 |
example</firstterm></link></para> |
| 3511 |
<para><link |
| 3512 |
linkend="ex16_0"><firstterm>Script |
| 3513 |
example</firstterm></link></para> |
| 3514 |
<para><link |
| 3515 |
linkend="varunsetting"><firstterm>Script |
| 3516 |
example</firstterm></link></para> |
| 3517 |
</listitem> |
| 3518 |
|
| 3519 |
<listitem><para><link |
| 3520 |
linkend="internalvariables"><firstterm>Bash</firstterm> |
| 3521 |
internal variables</link></para></listitem> |
| 3522 |
<listitem><para><link |
| 3523 |
linkend="setvaremb">Block of <firstterm>sed</firstterm> or |
| 3524 |
<firstterm>awk</firstterm> code</link>, setting a variable |
| 3525 |
to</para></listitem> |
| 3526 |
<listitem><para> |
| 3527 |
<firstterm>C-style</firstterm> |
| 3528 |
<link linkend="plusplusref"> |
| 3529 |
increment/decrement/trinary operations</link></para></listitem> |
| 3530 |
<listitem><para> |
| 3531 |
<link linkend="setref">Change value of internal script variables</link> |
| 3532 |
using <firstterm>set</firstterm></para></listitem> |
| 3533 |
<listitem><para><link linkend="declare1ref">declare</link>, |
| 3534 |
to modify the properties of variables</para></listitem> |
| 3535 |
<listitem><para><link linkend="unsetref">Deleting a shell variable</link> |
| 3536 |
using <firstterm>unset</firstterm></para></listitem> |
| 3537 |
<listitem><para><link |
| 3538 |
linkend="envref">Environmental</link></para></listitem> |
| 3539 |
<listitem><para><link linkend="exprepl1">Expansion / Substring |
| 3540 |
replacement</link> operators</para></listitem> |
| 3541 |
|
| 3542 |
<listitem> |
| 3543 |
<para><link linkend="ivrref">Indirect |
| 3544 |
referencing</link></para> |
| 3545 |
<para><replaceable>eval variable1=\$$variable2</replaceable></para> |
| 3546 |
|
| 3547 |
<para><link linkend="ivr2">Newer notation</link></para> |
| 3548 |
<para><replaceable>${!variable}</replaceable></para> |
| 3549 |
</listitem> |
| 3550 |
|
| 3551 |
<listitem><para><link |
| 3552 |
linkend="intvarref">Integer</link></para></listitem> |
| 3553 |
<listitem><para><link |
| 3554 |
linkend="bvuntyped">Integer / string</link> (variables are |
| 3555 |
untyped)</para></listitem> |
| 3556 |
|
| 3557 |
<listitem><para><link linkend="psorex1">Length</link></para> |
| 3558 |
<para><replaceable>${#var}</replaceable></para></listitem> |
| 3559 |
<listitem><para><link |
| 3560 |
linkend="lvalueref">Lvalue</link></para></listitem> |
| 3561 |
<listitem><para><link linkend="pssub1">Manipulating and |
| 3562 |
expanding</link></para></listitem> |
| 3563 |
<listitem><para><link linkend="varnameval"><firstterm>Name</firstterm> |
| 3564 |
and <firstterm>value</firstterm> of a variable</link>, |
| 3565 |
distinguishing between</para></listitem> |
| 3566 |
<listitem><para><link linkend="stringnotnull"><firstterm>Null</firstterm> |
| 3567 |
string</link>, testing for</para></listitem> |
| 3568 |
<listitem><para><link linkend="nullvar"><firstterm>Null</firstterm> |
| 3569 |
variable assignment</link>, avoiding</para></listitem> |
| 3570 |
<listitem> |
| 3571 |
<para><link linkend="quotingvar">Quoting</link></para> |
| 3572 |
<para><link |
| 3573 |
linkend="failquote">within <firstterm>test</firstterm> |
| 3574 |
brackets</link></para> |
| 3575 |
<para><link linkend="wsquo">to preserve |
| 3576 |
<firstterm>whitespace</firstterm></link></para> |
| 3577 |
</listitem> |
| 3578 |
<listitem><para><link |
| 3579 |
linkend="lvalueref">rvalue</link></para></listitem> |
| 3580 |
<listitem><para><link |
| 3581 |
linkend="varunsetting">Setting to <firstterm>null</firstterm> |
| 3582 |
value</link></para></listitem> |
| 3583 |
<listitem><para><link linkend="parvis">In |
| 3584 |
<firstterm>subshell</firstterm></link> |
| 3585 |
not visible to parent shell</para></listitem> |
| 3586 |
<listitem><para>Testing a variable <link linkend="intparam"> |
| 3587 |
if it contains only digits</link></para></listitem> |
| 3588 |
<listitem><para><link linkend="typingref">Typing</link>, |
| 3589 |
restricting the properties of a variable</para></listitem> |
| 3590 |
<listitem><para><link linkend="undvarerr">Undeclared</link>, |
| 3591 |
error message</para></listitem> |
| 3592 |
<listitem><para><link linkend="uninitvar1">Uninitialized</link> |
| 3593 |
</para></listitem> |
| 3594 |
<listitem><para><link linkend="varsplitting">Unquoted |
| 3595 |
variable</link>, |
| 3596 |
<firstterm>splitting</firstterm></para></listitem> |
| 3597 |
<listitem><para><link |
| 3598 |
linkend="unsetref">Unsetting</link></para></listitem> |
| 3599 |
<listitem><para><link |
| 3600 |
linkend="bvuntyped">Untyped</link></para></listitem> |
| 3601 |
|
| 3602 |
</itemizedlist></para> |
| 3603 |
|
| 3604 |
<para>* * *</para> |
| 3605 |
|
| 3606 |
<para><link linkend="waitref">wait</link>, |
| 3607 |
suspend script execution |
| 3608 |
<itemizedlist> |
| 3609 |
<listitem><para><link linkend="waithang">To remedy |
| 3610 |
script hang</link></para></listitem> |
| 3611 |
</itemizedlist></para> |
| 3612 |
|
| 3613 |
|
| 3614 |
<para><link linkend="dblquo"><firstterm>Weak</firstterm> quoting</link> |
| 3615 |
<command>" ... "</command></para> |
| 3616 |
|
| 3617 |
|
| 3618 |
<para><link linkend="whileloopref">while</link> loop</para> |
| 3619 |
<para><firstterm>while [ condition ]; do</firstterm> |
| 3620 |
<itemizedlist> |
| 3621 |
<listitem><para><link linkend="whloopc">C-style syntax</link> |
| 3622 |
</para></listitem> |
| 3623 |
<listitem><para><link linkend="whilefunc">Calling a |
| 3624 |
<firstterm>function</firstterm> within |
| 3625 |
<firstterm>test</firstterm> brackets</link></para></listitem> |
| 3626 |
<listitem><para><link linkend="whmultcond">Multiple |
| 3627 |
conditions</link></para></listitem> |
| 3628 |
<listitem><para><link linkend="whilenobrackets">Omitting |
| 3629 |
<firstterm>test</firstterm> brackets</link></para></listitem> |
| 3630 |
<listitem> |
| 3631 |
<para><link linkend="whilereadref2"> |
| 3632 |
<firstterm>while read</firstterm></link> |
| 3633 |
construct |
| 3634 |
</para> |
| 3635 |
<para><link linkend="goodread0">Avoiding a |
| 3636 |
<firstterm>subshell</firstterm></link></para> |
| 3637 |
</listitem> |
| 3638 |
</itemizedlist></para> |
| 3639 |
|
| 3640 |
<para><link linkend="whitespaceref">Whitespace</link>, |
| 3641 |
spaces, tabs, and newline characters |
| 3642 |
<itemizedlist> |
| 3643 |
<listitem><para><link linkend="ifsws"><varname>$IFS</varname> defaults |
| 3644 |
to</link></para></listitem> |
| 3645 |
<listitem><para><link linkend="wsbad">Inappropriate use |
| 3646 |
of</link></para></listitem> |
| 3647 |
<listitem><para><link linkend="indentedls">Preceding closing |
| 3648 |
<firstterm>limit string</firstterm></link> in a <firstterm>here |
| 3649 |
document</firstterm>, error</para></listitem> |
| 3650 |
<listitem><para><link linkend="wsbcomm">Preceding script |
| 3651 |
comments</link></para></listitem> |
| 3652 |
<listitem><para><link |
| 3653 |
linkend="wsquo"><firstterm>Quoting</firstterm></link>, |
| 3654 |
to preserve <firstterm>whitespace</firstterm> within strings |
| 3655 |
or variables</para></listitem> |
| 3656 |
<listitem><para><link linkend="wsposix">[:space:]</link>, |
| 3657 |
<firstterm>POSIX</firstterm> character class</para></listitem> |
| 3658 |
</itemizedlist></para> |
| 3659 |
|
| 3660 |
<para><link linkend="whoref">who</link>, information about logged on users |
| 3661 |
<itemizedlist> |
| 3662 |
<listitem><para><link linkend="wref">w</link></para></listitem> |
| 3663 |
<listitem><para><link |
| 3664 |
linkend="whoamiref">whoami</link></para></listitem> |
| 3665 |
<listitem><para><link linkend="lognameref">logname</link></para></listitem> |
| 3666 |
</itemizedlist></para> |
| 3667 |
|
| 3668 |
<para><link linkend="widgetref">Widgets</link></para> |
| 3669 |
|
| 3670 |
<para><link linkend="wildcarddef">Wild card</link> characters |
| 3671 |
<itemizedlist> |
| 3672 |
<listitem><para><link linkend="asteriskref">Asterisk |
| 3673 |
*</link></para></listitem> |
| 3674 |
<listitem><para>In <link linkend="liglob"> |
| 3675 |
<replaceable>[list]</replaceable> constructs</link> |
| 3676 |
</para></listitem> |
| 3677 |
<listitem><para><link linkend="wildcardqu">Question mark |
| 3678 |
?</link></para></listitem> |
| 3679 |
<listitem><para><link linkend="wdotfilewc">Will not match |
| 3680 |
<filename>dot files</filename></link></para></listitem> |
| 3681 |
</itemizedlist></para> |
| 3682 |
|
| 3683 |
<para>Word splitting |
| 3684 |
<itemizedlist> |
| 3685 |
<listitem><para><link |
| 3686 |
linkend="wsplitref">Definition</link></para></listitem> |
| 3687 |
<listitem><para><link |
| 3688 |
linkend="csws">Resulting from <firstterm>command |
| 3689 |
substitution</firstterm></link></para></listitem> |
| 3690 |
</itemizedlist></para> |
| 3691 |
|
| 3692 |
<para><link linkend="shwrapper">Wrapper</link>, shell</para> |
| 3693 |
|
| 3694 |
<para>* * *</para> |
| 3695 |
|
| 3696 |
<para><link linkend="xargsref">xargs</link>, |
| 3697 |
Filter for grouping arguments |
| 3698 |
<itemizedlist> |
| 3699 |
<listitem><para><link linkend="xargscurlyref"> |
| 3700 |
Curly brackets</link></para></listitem> |
| 3701 |
<listitem><para><link linkend="xargslimargs"> |
| 3702 |
Limiting arguments passed</link></para></listitem> |
| 3703 |
<listitem><para><link |
| 3704 |
linkend="xargslimargs">Options</link></para></listitem> |
| 3705 |
<listitem><para>Processes arguments <link |
| 3706 |
linkend="xargsoneatatime">one at a time</link></para></listitem> |
| 3707 |
<listitem><para><link linkend="xargsws"> |
| 3708 |
Whitespace</link>, handling</para></listitem> |
| 3709 |
</itemizedlist></para> |
| 3710 |
|
| 3711 |
<para>* * *</para> |
| 3712 |
|
| 3713 |
<para><link linkend="yesref">yes</link> |
| 3714 |
<itemizedlist> |
| 3715 |
<listitem><para><link |
| 3716 |
linkend="yesemu">Emulation</link></para></listitem> |
| 3717 |
</itemizedlist></para> |
| 3718 |
|
| 3719 |
<para>* * *</para> |
| 3720 |
|
| 3721 |
<para><command>-z </command> |
| 3722 |
<link linkend="stringnull">String is |
| 3723 |
<firstterm>null</firstterm></link></para> |
| 3724 |
<para><link linkend="zombieref"><firstterm>Zombie</firstterm></link>, |
| 3725 |
a process that has terminated, but not yet been <link |
| 3726 |
linkend="killref">killed</link> by its |
| 3727 |
<link linkend="parentref">parent</link></para> |