Learning the bash Shell

Third Edition April 2005
ISBN 978-0-596-00965-6
Seiten 352
EUR34.00, SFR57.90


Weitere Informationen zu diesem Buch

Inhaltsverzeichnis | Index | Probekapitel | Kolophon | Rezensionen |


Index

	
[ Symbols ], [ Numbers ], [ A ], [ B ], [ C ], [ D ], [ E ], [ F ], [ G ], [ H ], [ I ], [ J ], [ K ], [ L ], [ M ], [ N ], [ O ], [ P ], [ Q ], [ R ], [ S ], [ T ], [ U ], [ V ], [ W ], [ X ], [ Y ], [ Z ],

Symbols[ Top ]
& (ampersand)
      && (logical and operator), 112, 118, 149
      &> (output and error redirection), 163
      bitwise and operator, 147
      running commands in background, 18, 199
* (asterisk)
      ** (exponentiation operator), 147
      environment variable, 86, 90, 290
      extended pattern-matching operator, 99
      multiplication operator, 147
      pattern-matching operator, 96
      special array index, 158
      textual completion, vi, 44
      wildcard, 11
      word designator, 48
@ (at sign)
      environment variable, 86, 90, 290
      extended pattern-matching operator, 99
      hostname completion, 34
      special array index, 158
\ (backslash)
      backslash-escaping, 22
      continuation character, 23, 179
      escape character, echo, 169
      escape character, prompt strings, 270
      textual completion, vi, 44
{} (braces)
      brace expansion wildcards, 13
      command blocks in, 176
      in shell variable syntax, 90
[] (brackets)
      [...] (condition test), 113, 266, 294-295
      [[...]] (condition test), 113, 270, 294-295
      wildcard, 11
^ (caret)
      bitwise exclusive or operator, 148
      event designator, 48
      pipe character, 251, 276
      representing CTRL key, 202
      vi command, 37
      word designator, 48
: (colon)
      :+ (string operator), 92, 95
      :- (string operator), 91
      := (string operator), 91, 94
      :? (string operator), 91, 106
      command, 288
      string operator, 92
, (comma)
      sequential evaluation operator, 148
      vi command, 43
$ (dollar sign)
      $((...)) (arithmetic expressions), 146
      $((...)) (arithmetic test), 149
      $$ (shell variable), 210
      environment variable, 290
      variable substitution, 34, 63, 182
      vi command, 37, 38
      word designator, 48
. (dot)
      .. (parent directory), 10
      command, 288
      current directory, 10
. (dot) (continued )
      preceding filenames, 10, 62
      synonym to source command, 56
      vi command, 41
" (double quotes)
      arithmetic expressions in, 146
      around shell variables, 63
      around special characters, 22
      backslash preceding, 23
      command line processing of, 183
= (equal sign)
      == (equal to operator), 148
      string comparison operator, 114
      textual completion, vi, 44
! (exclamation point)
      != (not equal to operator), 149
      != (string comparison operator), 114
      conditional not operator, 112
      debugger command, 236
      environment variable, 290
      event designators, 47
      extended pattern-matching operator, 99
      logical not operator, 148
      negation operator, 118
      negation wildcard, 12
      process ID shell variable, 210
> (greater than sign)
      >> (bit-shift right operator), 147
      >= (greater than or equal to operator), 148
      >& (output redirection), 163, 167
      >&- (output redirection), 163
      >> (output redirection), 162
      >| (output redirection), 163, 164
      greater than operator, 148
      output redirection, 16, 162
      string comparison operator, 114
# (hash mark)
      ## (pattern-matching operator), 96
      array element length operator, 158
      comments, 93
      environment variable, 87, 290
      length operator, 99
      pattern-matching operator, 96, 106
      prepend comment, vi, 45
      printf flag, 172
- (hyphen)
      -- (decrement operator), 147
      append word, vi, 45
      environment variable, 290
      preceding options, 7
      printf flag, 172
      subtraction operator, 147
      vi command, 41
< (less than sign)
      << (bit-shift left operator), 147
      << (here-document), 163, 164-167
      <& (input redirection), 163
      <&- (input redirection), 163
      <> (input/output redirection), 163
      <= (less than or equal to operator), 148
      input redirection, 162
      less than operator, 148
      redirecting input, 16
      string comparison operator, 114
() (parentheses)
      ((...)) (arithmetic test), 150, 266, 270
      command substitution, 100
      grouping conditional operators, 118
      in arithmetic expressions, 148
      nested subshells, 218
% (percent sign)
      %? (job containing string), 200
      %% (job most recently put in background), 200
      %+ (job most recently put in background), 200
      %- (job second-most recently put in background), 200
      %% (pattern-matching operator), 96, 106
      job numbers, 199
      modulus operator, 147
      pattern-matching operator, 96
      printf format specifiers, 171, 173
      word designator, 48
+ (plus sign)
      ++ (increment operator), 147
      addition operator, 147
      extended pattern-matching operator, 99
      printf flag, 172
      vi command, 41
      xtrace output, 223
? (question mark)
      debugger command, 236
      environment variable, 111, 290
      extended pattern-matching operator, 99
      vi command, 41
      wildcard, 11
; (semicolon)
      statement separator, 115
      vi command, 43
' (single quotes)
      around special characters, 21
      command line processing of, 183
      enclosing RETURN, 23
      in alias definition, 59
      when to use, 147
/ (slash)
      // (pattern-matching and replacement operator), 96
      division operator, 147
      in restricted shell, 258
      pattern-matching and replacement operator, 96
      vi command, 41
~ (tilde)
      bitwise not operator, 148
      home directory, 182
      in pathnames, 9, 276
      invert case, vi, 45
      username completion, 34
| (vertical bar)
      || (logical or operator), 112, 118, 149
      bitwise or operator, 147
      extended pattern matching, 99
      in case statement, 129
      pipe, 16, 162, 180
      vi command, 44

Numbers[ Top ]
$0 positional parameter, 86
0 (zero) environment variable, 290
0 (zero) printf flag, 172
0 (zero) word designator, 48
$1 positional parameter, 86
$2 positional parameter, 86
$3 positional parameter, 86

A[ Top ]
A command, vi, 39
a command, vi, 39
-a (file attribute operator), 117
-a (logical operator), 118
absolute pathname (see full pathname)
album example, 92, 101
alias command, 58, 288
aliases, 57-60, 270
      Bourne shell not supporting, 276
      examples in archive for, 272
      global (not possible), 258
      order of precedence for, 84
      processing on command line, 182
      recursive, 182
      wildcards in, 59
ampersand (&)
      && (logical and operator), 112, 118, 149
      &> (output and error redirection), 163
      bitwise and operator, 147
      running commands in background, 18, 199
angle brackets (see greater than sign; less than sign)
archive file for bash, 268
arguments, 6
      for command-line options, 140
      in for statement list, 122, 123
      positional parameters for, 86-88
arithmetic conditionals, 149
arithmetic expressions, 146
      associativity in, 147
      evaluation of, 182
      precedence in, 147
      syntax for, 146
arithmetic for statement, 155, 159-161
arithmetic (integer) variables
      assignment, 150-155
      declaring, 145, 146
arithmetic operators, 121, 147
arrays, 157-161
      assigning to themselves (bug), 239
      assigning values to, 157
      associative, Korn, 280
      declaring, 158
      declaring variables as, 145
      deleting, 159
      deleting elements of, 159
      element length operator for, 158
      one-dimensional, 270, 280
      reading values into, 179
      special indices for, 158
arrow keys, emacs, 29, 32
assignment of arithmetic variables, 150-155
associative arrays, Korn, 280
asterisk (*)
      ** (exponentiation operator), 147
      environment variable, 86, 90, 290
      extended pattern-matching operator, 99
      multiplication operator, 147
      pattern-matching operator, 96
      special array index, 158
      textual completion, vi, 44
      wildcard, 11
      word designator, 48
at sign (@)
      environment variable, 86, 90, 290
      extended pattern-matching operator, 99
at sign (@) (continued )
      hostname completion, 34
      special array index, 158
AT&T UWIN package, 284
auto_resume environment variable, 294
awk command, 101

B[ Top ]
B command, vi, 37, 38
b command, vi, 37, 38
background I/O, 19
background jobs, 17-20
      bringing to foreground, 199
      job number for, 198
      priority of, 20
      process ID for, 210
      saving standard output and error to one file, 167, 188
      sending foreground jobs to, 200
      sending job to background, 201
      starting, 18, 199
      waiting until finished, 215
backslash (\)
      backslash-escaping, 22
      continuation character, 23, 179
      escape character, echo, 169
      escape character, prompt strings, 270
      textual completion, vi, 44
BACKSPACE command, 25
bash, 2
      archive file for, 268
      bugs in, reporting, 274
      building, 269
      configuring, 269-271
      customizing environment for, 254-258
      documentation for, 268, 269
      environment, 55
      examples in archive for, 268, 272
      features of, x, 4
      global customization of, 257
      help for, 273
      history of, 4
      installing, 270
      installing as login shell, 5, 272
      installing as standard shell, 251
      interactive use of, 6
      location of, determining, 6
      newsgroups for, 274
      obtaining, 5, 267
      online help for, 26
      options, 60-62, 285-287
      pathname of, 74
      POSIX mode, 252, 254
      privileged mode, 260
      programming featuers of, 81
      restricted shell, 253, 258, 271
      security, 258-260
      shell variables, 62-64, 86
      support for, 274
      testing, 271
      troubleshooting installation of, 271
      unpacking archive file, 268
      version of, determining, 74, 254
      versions of, ix, 4
      when not to use, 266
bash command, 5
      - option, 253, 286
      - option (old), 286
      -c option, 253, 285
      -c option (old), 286
      -D option, 253, 285
      --debugger option, 229, 286
            debugging enabling, 253
      --dump-po-strings option, 253, 286
      --dump-strings option, 253, 286
      --help option, 253, 264, 286
      -i option, 253, 285
      -i option (old), 286
      --init-file option, 254, 286
      -l option, 253, 285
      --login option, 254, 286
      -login option (old), 287
      -n option, 222, 224
      -nobraceexpansion option (old), 287
      --noediting option, 254, 286
      -nolineediting option (old), 287
      --noprofile option, 254, 286
      -noprofile option (old), 286
      --norc option, 254, 286
      -norc option (old), 286
      -O, +O options, 253, 285
      -o option, 253, 285
      options for, list of, 253, 285-287
      --posix option, 252, 254, 286
      -posix option (old), 287
      --quiet option, 254, 286
      -quiet option (old), 287
      -r option, 253, 271, 286
      -r option (old), 286
      --rcfile option, 254, 286
      -rcfile option (old), 286
      -s option, 253, 285
      -s option (old), 286
      -T option, 228
      -v option, 222, 253, 286
      --verbose option, 254, 286
      --version option, 254, 264, 286
      -version option (old), 286
      -x option, 222, 223
bash Completion Project, 312
Bash Debugger Project, 242
BASH environment variable, 74, 78, 291
BASH_ARGC environment variable, 230, 291
BASH_ARGV environment variable, 230, 291
bashbug script, 274
BASH_COMMAND environment variable, 291
bashdb debugger, 221, 230-234
      break conditions, 241
      breakpoints feature, 230, 236, 237
      commands for, 235-236
      driver script for, 231
      execution tracing, 241
      exercises for, 244
      functions file for, 233
      functions for, 234-242
      limitations of, 241
      preamble file for, 232
      sample session of, 242-244
      source code for, 245
      stepping feature, 230, 236, 237
BASH_ENV environment variable, 258, 260, 291
BASH_EXECUTION_STRING environment variable, 291
.bash_history file, 28
BASH_LINENO environment variable, 230, 291
.bash_login file, 57
.bash_logout file, 57
.bash_profile file, 56, 79
      environment file and, 79
      environment variables in, 76
      restricted, 259
.bashrc file, 57, 79
      ignoring, 254
      restricted, 259
BASH_REMATCH environment variable, 291
BASH_SOURCE environment variable, 230, 291
BASH_SUBSHELL environment variable, 291
BASH_VERSINFO environment variable, 74, 291
BASH_VERSION environment variable, ix, 74, 291
bc command, debugger, 236, 241
bell-style variable, readline, 51
bg command, 201, 270, 288
biff command, 67
bind command, 52, 288
books
      Learning the UNIX Operating System (Peek, Todino, Strang), x
      Practical UNIX and Internet Security (Spafford, Garfinkel), 260
Bourne Again shell (see bash)
Bourne shell (see sh)
Bourne, Steven, 3
bp command, debugger, 236, 237
brace expansion, 13, 182, 270
braces ({})
      brace expansion wildcards, 13
      command blocks in, 176
      in shell variable syntax, 90
brackets ([])
      [...] (condition test), 113, 266, 294-295
      [[...]] (condition test), 113, 270, 294-295
      wildcard, 11
break command, 288
break conditions, 241
break statement, 133
breakpoints, 230, 236, 237
BSD-derived systems, ps command on, 207
bugs, reporting, 274
builtin command, 84, 110, 185, 270, 288
      Bourne shell not supporting, 277
      -p option, 259
built-in functions
      in bash archive, 304
      loadable, 304-308

C[ Top ]
C command, vi, 40
C shell (see csh)
caret (^)
      bitwise exclusive or operator, 148
      event designator, 48
      pipe character, 251, 276
      representing CTRL key, 202
      vi command, 37
      word designator, 48
case sensitivity, 36
case statement, 128-131
cat command, 15
cb command, debugger, 236, 238
cc command, vi, 40
cd command, 9, 288
      - option, 10, 104
      Bourne shell support, 276
      CDPATH variable and, 73
      in restricted shell, 258
      variables in, 62
cdable_vars shell option, 62, 74
CDPATH environment variable, 73, 291
character-based user interfaces, 2
checkhash shell option, 62
chmod command, 82
chsh command, 6, 272
circumflex (see caret)
cmdhist shell option, 62
cmp command, 219
code examples (see examples)
colon (:)
      :+ (string operator), 92, 95
      :- (string operator), 91
      := (string operator), 91, 94
      :? (string operator), 91, 106
      command, 288
      string operator, 92
COLUMNS environment variable, 76, 79
comma (,)
      sequential evaluation operator, 148
      vi command, 43
command aliases, 58
command blocks, 176, 279
command command, 84, 126, 184, 288
      - option, 185
      Bourne shell not supporting, 277
      -p option, 185
      -V option, 185
      -v option, 185
command history, 27, 28
      appending to, 62
      displaying, 289
      emacs editing mode, 31
      expansion commands, 47
      fc command, 28, 45-47
      multiple-line commands in, 62
      size of, 65
      time stamp for, 66
      vi editing mode, 41-42
command line processing, 180-183
      builtin command affecting, 185
      command command affecting, 184
      enable command affecting, 185
      quoting affecting, 183
      repeating, 186-196
command substitution, 99-103, 277
command-line editing, 5
      command history with fc command, 45-47
      emacs editing mode, 29-36
      history expansion, 47
      readline editing interface, 49-53
      selecting editing mode, 28
      shell variables for, 64-67
      vi editing mode, 36-45
      which editing mode to use, 53
command-line options, 7
      for bash, list of, 285-287
      for bash, setting, 60-62
      guidelines for, 263-265
      handling with positional parameters, 137-145
      with arguments, 140
commands, 6
      : (colon), 288
      . (dot), 288
      alias command, 58, 288
      arguments for, 6
      arguments for, in for statement list, 122, 123
      arguments for, positional parameters for, 86-88
      awk command, 101
      bash command, 57
      bash command (see bash command)
      bg command, 201, 270, 288
      biff command, 67
      bind command, 52, 288
      break command, 288
      builtin command, 84, 110, 185, 259, 270, 288
      built-in, list of, 288-290
      cat command, 15
      cd command, 9, 10, 62, 73, 104, 258, 288
      chmod command, 82
      chsh command, 6, 272
      cmp command, 219
      command command, 84, 126, 184, 288
      compgen command, 288, 310-312
      complete command, 288, 309-312
      continue command, 288
      continuing beyond a single line, 23, 179
      countargs command, 90
      cut command, 15, 100
      date command, 147
      dc command, 177
      declare command, 84, 145, 158, 229, 288
      determining source of, 85
      diff command, 19, 109
      dirs command, 155, 270, 281, 288
      disown command, 212, 288
      du command, 151
      echo command, 63, 95, 120, 127, 168, 222, 288
      editing on command line (see command-line editing)
      enable command, 84, 185, 259, 270, 289, 304
      eval command, 186-196, 289
      exec command, 62, 258, 289
      exit command, 6, 211, 289
      exit status of, 108-113
      export command, 75, 76, 289
      fc command, 28, 45-47, 270, 289
      fg command, 199, 270, 289
      file command, 251
      find command, 22
      for bashdb debugger, 235
      getopts command, 140, 289
      grep command, 15, 100
      hash command, 72, 289
      hashing, 72
      help command, 26, 270, 276, 289
      history command, 270, 289
      in hash table, 62
      jobs command, 18, 199, 204, 270, 289
      kill command, 202, 203, 208, 289
      let command, 150, 289
      local command, 88, 277, 289
      logout command, 6, 289
      ls command, 10, 58, 125
      make command, 269
      more command, 16
      multiple, I/O redirection and, 175
      nice command, 20
      nohup command, 212
      number of, determining, 65
      order of precedence for, 84
      popd command, 152, 155, 270, 289
      precedence of, overriding, 184
      precedence of, POSIX, 279
      printf command, 170-173
      ps command, 204-207
      pushd command, 152, 155, 270, 289
      pwd command, 9, 289
      rbash command, 271
      read command, 173-180, 289
      readonly command, 146, 289
      renaming (see aliases)
      return command, 289
      running in background, 17-20
      sed command, 15
      set command, 60
      set command (see set command)
      shell variables in, 63
      shift command, 138-140, 289
      shopt command, 61, 229, 297-298
      sort command, 15, 92, 238
      source command, 56, 81
      stty command, 24, 202
      suspend command, 289
      tee command, 168
      test command, 113, 289
      time command, 270
      times command, 290
      tr command, 15
      trap command, 207-214, 224-229, 290
      true command, 208
      type command, 72, 85, 290
      typeset command, 145, 290
      ulimit command, 255-257, 277, 290
      umask command, 255, 277, 290
      unalias command, 60, 290
      unset command, 63, 84, 159, 290
      wait command, 215, 290
      who command, 102
comment-begin variable, readline, 51
comments, 93
      guidelines for, 261
      in input files, handling, 177
      prepending, vi, 45
COMP_CWORD environment variable, 291
compgen command, 288, 310-312
COMPGEN variable, 311
complete command, 288, 309-312
completion, textual
      emacs editing mode, 33-35
      programmable, 271, 309-312
      vi editing mode, 44
completion-query-items variable, readline, 51
COMP_LINE environment variable, 291
COMP_POINT environment variable, 291
COMPREPLY environment variable, 292
COMP_WORDBREAKS environment variable, 292
COMP_WORDS environment variable, 292
concurrency control, 217
conditional construct, 108
      case statement, 128-131
      select statement, 131-134
conditionals, readline editing interface, 51
conditions, 108
      arithmetic operators for, 149
      exit status determining, 108-113
      file attribute checking, 117-121
      integer comparisons, 121
      logical operators for, 112
      string comparisons, 113-117
      testing, 113-122
configure script, 269
      --disable option, 270
      --enable option, 270
constants, naming, 263
contact information, xiv
continuation character (\), 23, 179
continue command, 288
continuing lines, 23
control keys, 24
      conflicting with editing mode commands, 28
      emacs commands, 29, 31, 34, 35
      vi commands, 36, 45
control mode, vi editing mode, 36, 37
control-key signals, 202
conventions used in this book, xiii
convert-meta variable, readline, 51
copy file example, 135
COPYING file, bash archive, 268
Copyleft for bash, 268
copylefted software, 4
coroutines, 214-217, 280
countargs command, 90
CPU-intensive processes, 215
csh (C shell), 3
      fc command, 28
      features from, included in bash, x
CTRL-? command, 24
CTRL-\ command, 24, 25, 202
CTRL-[ command, emacs, 35
CTRL keys (see control keys)
CTRL-A command, emacs, 31
CTRL-B command, emacs, 29
CTRL-C command, 24, 25, 201, 202, 208
CTRL-D command, 6, 24, 25, 61, 133
CTRL-D command, emacs, 29
CTRL-E command, emacs, 31
CTRL-F command, emacs, 29
CTRL-H command, 25
CTRL-J command, emacs, 35, 36
CTRL-K command, emacs, 31
CTRL-L command, emacs, 35
CTRL-L command, vi, 45
CTRL-M command, 24
CTRL-M command, emacs, 35, 36
CTRL-N command, emacs, 32
CTRL-O command, emacs, 35
CTRL-P command, emacs, 32
CTRL-Q command, 24, 25
CTRL-R command, emacs, 32
CTRL-S command, 24, 25
CTRL-T command, emacs, 35
CTRL-U command, 24
CTRL-U command, emacs, 35
CTRL-V command, emacs, 35, 36
CTRL-V command, vi, 36
CTRL-W command, emacs, 35
CTRL-W command, vi, 36
CTRL-X ! command, emacs, 35
CTRL-X $ command, emacs, 34
CTRL-X / command, emacs, 34
CTRL-X @ command, emacs, 34
CTRL-Y command, 201
CTRL-Y command, emacs, 30, 31
CTRL-Z command, 24, 201, 202
current directory (see working directory)
cut command, 15, 100, 101
cygwin environment (Cygnus Consulting), 282

D[ Top ]
D command, vi, 40
d$ command, vi, 40
-d (file attribute operator), 117
d0 command, vi, 40
data filtering utilities, 15
date command, 147
dB command, vi, 40
db command, vi, 40
dc command, 177
dd command, vi, 40
DEBUG signal, 225, 228, 238
debugging, 221
      bashdb debugger, 221, 230-234
            commands for, 235-236
            functions for, 234-242
            sample session of, 242-244
            source code for, 245
      bugs in bash, reporting, 274
      echo command, 222
      environment variables for, 230
      fake signals, 224-229
      set command, 222-224
declare command, 145, 288
      -a option, 145, 158
      -F option, 145, 229
      -f option, 84, 145
      -i option, 145, 146
      -r option, 145, 146, 158
DEL command, 24, 25
DEL command, emacs, 29, 30
DEL command, vi, 36
dh command, vi, 40
diff command, 19, 109
directories, 7
      home, 74
      navigating, 9
      tilde (~) notation, 9
      working, 8, 74
directory listing example, 98, 123, 125, 135
directory name, alias for, 59
dirs command, 155, 270, 281, 288
DIR_STACK environment variable, 105, 114, 152, 292
disable-completion variable, readline, 51
disk space usage example, 151-152
disown command, 212, 288
DJGPP suite, GNU tools for MS-DOS, 283
dl command, vi, 40
doc directory, bash archive, 268, 269
documentation directory, bash, 269
dollar sign ($)
      $((...)) (arithmetic expressions), 146
      $((...)) (arithmetic test), 149
      $$ (shell variable), 210
      environment variable, 290
      variable substitution, 34, 63, 182
      vi command, 37, 38
      word designator, 48
dot (.)
      .. (parent directory), 10
      command, 288
      current directory, 10
      preceding filenames, 10, 62
      synonym to source command, 56
      vi command, 41
dot (point) in emacs, 29
dotglob shell option, 62
double quotes (")
      arithmetic expressions in, 146
      around shell variables, 63
      around special characters, 22
      backslash preceding, 23
      command line processing of, 183
      command substitution, 100
      when to use, 100
ds command, debugger, 236, 239
du command, 151
dW command, vi, 40
dw command, vi, 40

E[ Top ]
E command, vi, 37, 38
e command, vi, 37, 38
-e (file attribute operator), 117
echo command, 63, 168, 222, 288
      Bourne shell support, 277
      -E option, 169
      -e option, 95, 127, 169
      escape sequences for, 169
      Korn not supporting, 280
      -n option, 95, 120, 169
ed text editor, 164
editing modes (see emacs editing mode; vi editing mode)
editing (see command-line editing)
editing-mode variable, readline, 51
EDITOR environment variable, 46, 75, 76, 78
electronic mail example, 210
elements of arrays, 157
elif clause, if statement, 108
else clause, if statement, 108
$else directive, readline, 51
emacs editing mode, 29-36
      commands conflicting with terminal interface control keys, 28
      commands for, list of, 300
      history commands, 31
      line commands, 31
      list of most-used commands, 54
      point in, 29
      selecting, 28, 61
      textual completion, 33-35
      when to use, 53
      word commands, 30
emacs shell option, 61
enable command, 84, 185, 289, 304
      -a option, 186
      Bourne shell not supporting, 277
      -d option, 185, 259
      -f option, 185, 259
      Korn not supporting, 281
      -n option, 186, 270
      -p option, 186
      -s option, 186
enable-keypad variable, readline, 51
$endif directive, readline, 51
ENV environment variable, 258, 280, 281
environment, 55
      customizing, 79, 254-258
      files containing settings for, 56
      shell variables, 62-64
      subprocesses awareness of, 75-79
environment file, 56, 79, 276
environment variables, 75-79, 86
      * (asterisk), 86, 90, 290
      @ (at sign), 86, 90, 290
      $ (dollar sign), 290
      ! (exclamation point), 290
      # (hash mark), 87, 290
      - (hyphen), 290
      ? (question mark), 111, 290
      0 (zero), 290
      auto_resume, 294
      BASH, 74, 78, 291
      BASH_ARGC, 230, 291
      BASH_ARGV, 230, 291
      BASH_COMMAND, 291
      BASH_ENV, 258, 260, 291
      BASH_EXECUTION_STRING, 291
      BASH_LINENO, 230, 291
      BASH_REMATCH, 291
      BASH_SOURCE, 230, 291
      BASH_SUBSHELL, 291
      BASH_VERSINFO, 74, 291
      BASH_VERSION, ix, 74, 291
      Bourne shell not supporting, list of, 276
      built-in, list of, 290-294
      CDPATH, 73, 291
      COLUMNS, 76, 79
      COMP_CWORD, 291
      COMP_LINE, 291
      COMP_POINT, 291
      COMPREPLY, 292
      COMP_WORDBREAKS, 292
      COMP_WORDS, 292
      declaring shell variables as, 145, 146
      defining for subprocess only, 76
      determining whether shell variable is, 76
      DIR_STACK, 105, 114, 152, 292
      EDITOR, 46, 75, 76, 78
      ENV, 258, 280, 281
      EUID, 292
      exported, 75
      FCEDIT, 46, 65, 292
      FIGNORE, 292
      FUNCNAME, 292
      GLOBIGNORE, 292
      GROUPS, 292
      histchars, 294
      HISTCMD, 64, 65, 292
      HISTCONTROL, 64, 65, 292
      HISTFILE, 28, 64, 292
      HISTFILESIZE, 64, 65, 292
      HISTIGNORE, 64, 65, 292
      HISTSIZE, 64, 65, 292
      HISTTIMEFORMAT, 65, 66, 292
      HOME, 74, 75, 292
      HOSTFILE, 292
      HOSTNAME, 293
      HOSTTYPE, 293
      IFS, 86, 90, 123, 292
      IGNOREEOF, 293
      in .bash_profile file, 76
      in subshells, 83
      INPUTRC, 50, 293
      LANG, 293
      LC_ALL, 293
      LC_COLLATE, 293
      LC_CTYPE, 293
      LC_MESSAGES, 293
      LC_NUMERIC, 293
      LINENO, 223, 233, 293
      LINES, 76, 79
      MACHTYPE, 293
      MAIL, 68, 75, 293
      MAILCHECK, 68, 293
      MAILPATH, 68, 293
      OLDPWD, 74, 293
      OPTARG, 142, 293
      OPTERR, 293
      OPTIND, 142, 293
      OSTYPE, 293
      PATH, 71, 75, 258, 293
      PIPESTATUS, 293
      POSIXLY_CORRECT, 293
      PPID, 294
      PROMPT_COMMAND, 293
      PS1, 69, 257, 270, 293
      PS2, 69, 270, 293
      PS3, 69, 270, 293
      PS4, 69, 270, 281, 294
      PWD, 74, 75, 294
      RANDOM, 226, 294
      REPLY, 173, 233, 294
      scripts relying on, 265
      SECOND, 74
      SECONDS, 294
      SHELL, 5, 76, 78, 258, 294
      SHELLOPTS, 294
      SHLVL, 294
      substitution, emacs editing mode, 34
      TERM, 75, 76, 77, 174
      TIMEFORMAT, 294
      TMOUT, 257, 294
      UID, 294
      VISUAL, 75
-eq (equal to test operator), 149
-eq (integer comparison operator), 121
equal sign (=)
      == (equal to operator), 148
      string comparison operator, 114
      textual completion, vi, 44
ERR signal, 225, 226
error, standard, 14, 167, 178
ESC-! command, emacs, 35
ESC-$ command, emacs, 34
ESC-. command, emacs, 35, 36
ESC-/ command, emacs, 34
ESC-< command, emacs, 31
ESC-> command, emacs, 31
ESC-? command, emacs, 34
ESC-@ command, emacs, 34
ESC-_ command, emacs, 35, 36
ESC-~ command, emacs, 34
ESC command, vi, 36
ESC-B command, emacs, 30
ESC-C command, emacs, 35
ESC-CTRL-H command, emacs, 30
ESC-D command, emacs, 30
ESC-DEL command, emacs, 30
ESC-F command, emacs, 30
ESC-L command, emacs, 35, 36
ESC-TAB command, emacs, 35
ESC-U command, emacs, 35
EUID environment variable, 292
eval command, 186-196, 289
event designators, 47
examples, xi
      in bash archive, 268, 272
      (see album example)
      (see copy file example)
      (see directory listing example)
      (see disk space usage example)
      (see electronic mail example)
      (see graphics utility example)
      (see killalljobs example)
      (see Korn cd example)
      (see ls by dates example)
      (see ls example)
      (see mail example)
      (see mail header lines, deleting, example)
      (see make utility example)
      (see multiple copies example)
      (see popd function example)
      (see printer file filter example)
      (see pushd directory stack example)
      (see pushd function example)
      (see selection sort example)
      (see standard error and output file example)
examples directory, bash archive, 268
exclamation point (!)
      != (not equal to operator), 149
      != (string comparison operator), 114
      conditional not operator, 112
      debugger command, 236
      environment variable, 290
      event designators, 47
      extended pattern-matching operator, 99
      logical not operator, 148
      negation operator, 118
      negation wildcard, 12
      process ID shell variable, 210
exec command, 62, 258, 289
exec statement, 232
execfail shell variable, 62
executable files, 7
execute permission, for scripts, 82
execution tracing, 241
exit command, 6, 211, 289
EXIT signal, 225
exit statement, 115
exit status of commands, 108-111
      combining, 112-113
      reversing, 112
expand-tilde variable, readline, 52
export command, 75, 76, 289
extglob shell option, 99

F[ Top ]
F command, vi, 43
f command, vi, 43
-f (file attribute operator), 117
fake signals, 224-229, 277
fc command, 28, 45-47, 270, 289
      -e option, 46
      -l option, 45
      -m option, 46
      -n option, 46
      -s option, 47
      -v option, 46
FCEDIT environment variable, 46, 65, 292
fg command, 199, 270, 289
FIGNORE environment variable, 292
file attribute checking, 117-121
file attribute operators, 117
file command, 251
file descriptors, 163, 167
filename completion, emacs editing mode, 34
filenames, 7
      special handling of, 270
      wildcards in, 10-13
files
      default permissions for, 255
      limits on, 255-257
      overwriting, 164
      overwriting with output redirection, not allowing, 61
      permissions for, 255
      reading lines from, 174
      redirecting output to, 14
      specifiying on command line, 265
      temporary, 211
      types of, 7
      (see also I/O)
filtering utilities, 15
find command, 22
flow control
      break statement, 133
      case statement, 128-131
      exit statement, 115
      for statement, 122-128
      if statement, 108
      select statement, 131-134
      select statements, 131
      until statement, 134-136
      while statement, 134-136
      (see also conditions)
flow control statements, 107
folders, 10
fonts used in this book, xiii
for statement, 122-128
      arithmetic, 155, 159-161
      configuring, 270
foreground jobs, 18
      bringing background jobs to, 199
      sending foreground jobs to background, 200
formatted output (see printf command)
Fox, Brian, 4
FSF (Free Software Foundation), 4, 267
full pathname, 8
FUNCNAME environment variable, 292
functions, 83-85
      Bourne shell not supporting, 277
      compared to scripts, 84
      declaring variables as function names, 145
      defined, listing, 84
      defining, 84
      deleting, 84
      displaying list of, 145
      examples in archive for, 273
      exit status of, specifying, 111
      global, 258
      global variables of, 87
      Korn support, 280
      loadable built-in functions, 304-308
      local variables in, 88
      local variables of, 87
      naming, 265
      order of precedence for, 84
      popd function example, 103-106
      positional parameters in, 87
      pushd function example, 103-106
      readline editing interface, 50
      return values of, 111
      traps and, 209

G[ Top ]
g command, debugger, 236
G command, vi, 41, 42
-G (file attribute operator), 117
Garfinkel, Simson (Practical UNIX and Internet Security), 260
-ge (greater than or equal to test operator), 149
-ge (integer comparison operator), 121
getopt command, Bourne shell, 277
getopts command, 140, 289
global customization, 257
global variables, 87
globbing, 12
      disabling, 61
      extended operators for, 99
      ignoring files for, 292
GLOBIGNORE environment variable, 292
GNU Copyleft for bash, 268
GNU project, 4
GNU tools for MS-DOS, 283
graphical user interface (GUI), 2
graphics utility example, 97, 142-145, 189
greater than sign (>)
      >> (bit-shift right operator), 147
      >= (greater than or equal to operator), 148
      >& (output redirection), 163, 167
      >&- (output redirection), 163
      >> (output redirection), 162
      >| (output redirection), 163, 164
      greater than operator, 148
      output redirection, 16, 162
      string comparison operator, 114
grep command, 15, 100
GROUPS environment variable, 292
-gt (greater than test operator), 149
-gt (integer comparison operator), 121
guest accounts, restricted shell for, 258
GUI (graphical user interface), 2
gunzip utility, 268

H[ Top ]
h command, debugger, 236
h command, vi, 37, 38, 41
hangup (HUP) signal, 212
hard limits, 257
hash command, 72, 289
hash mark (#)
      ## (pattern-matching operator), 96
      array element length operator, 158
      comments, 93
      environment variable, 87, 290
      length operator, 99
      pattern matching operator, 96
      pattern-matching operator, 106
      prepend comment, 45
      printf flag, 172
hash tables, 62, 72
hashall shell option, 73
head utility, 93
header files, for built-in functions, 306
help
      for bash, 273
      for built-in functions, 306
help command, 26, 270, 276, 289
here-documents, 163, 164-167
hidden files, 10
histappend shell option, 62
histchars environment variable, 294
HISTCMD environment variable, 64, 65, 292
HISTCONTROL environment variable, 64, 65, 292
HISTFILE environment variable, 28, 64, 292
HISTFILESIZE environment variable, 64, 65, 292
HISTIGNORE environment variable, 64, 65, 292
history command, 270, 289
history of commands, 27, 28
      appending to, 62
      displaying, 289
      emacs editing mode, 31
      expansion commands, 47
      fc command, 28, 45-47
      multiple-line commands in, 62
      size of, 65
      time stamp for, 66
      vi editing mode, 41-42
HISTSIZE environment variable, 64, 65, 292
HISTTIMEFORMAT environment variable, 65, 66, 292
home directory, 8, 9, 74
HOME environment variable, 74, 75, 292
horizontal-scroll-mode variable, readline, 52
HOSTFILE environment variable, 292
hostname completion, emacs editing mode, 34
HOSTNAME environment variable, 293
HOSTTYPE environment variable, 293
HUP (hangup) signal, 212
hyphen (-)
      -- (decrement operator), 147
      append word, vi, 45
      environment variable, 290
      preceding options, 7
      printf flag, 172
      subtraction operator, 147
      vi command, 41

I[ Top ]
I command, vi, 39
i command, vi, 39
IEEE POSIX 1003.2 shell, 275, 278-280
$if directive, readline, 51
if statement, 108
IFS environment variable, 86, 90, 123, 292
ignoredups option, 65
IGNOREEOF environment variable, 293
ignoreeof shell option, 61
indices of array elements, 157
indirect expansion, 194
infinite loops, guarding against, 257
infinite recursion, 110
input
      from user, reading, 178
      standard, 14, 167, 253
      (see also I/O)
input files, as command-line arguments, 265
input mode, vi editing mode, 36, 39
input redirection (see I/O redirection)
input-meta variable, readline, 52
INPUTRC environment variable, 50, 293
.inputrc file, 28, 50-52
INT (interrupt) signal, 202, 208
integer comparisons, 121
integer variables (see arithmetic variables)
interactive processes, 215
interactive use of bash, 6
internal field separator (IFS), 86, 90
interprocess communication (IPC), 202
interrupt (INT) signal, 202
interrupt key, 25
I/O, 14-17
      background I/O, 19
      for strings, 168-180
I/O redirection, 14, 16, 162-168
      Bourne shell support, 277
      exec command with, 232
      files overwritten with, not allowing, 61
      in restricted shell, 258
      list of redirectors, 298
      multiple commands and, 175
      pdksh support, 281
I/O-intensive processes, 215
IPC (interprocess communication), 202
iteration, 122

J[ Top ]
j command, vi, 41
job control, 5, 17-20, 198-201
      Bourne shell support, 277
      bringing background job to foreground, 199
      configuring, 270
      foreground jobs, 18
      listing running jobs, 199
      priority of jobs, 20
      resuming suspended jobs, 201
      sending foreground jobs to background, 200
      suspending jobs, 200
job number, 198
jobs command, 18, 199, 270, 289
      Bourne shell not supporting, 276
      -l option, 199
      -n option, 199
      -p option, 199, 204
      -r option, 199
      -s option, 199
      -x option, 199
Joy, Bill, 3

K[ Top ]
k command, vi, 41
key bindings, readline, 50, 52
keymap variable, readline, 52
keywords, processing on command line, 180
kill command, 202, 203, 208, 289
KILL signal, 202
killalljobs example, 204
Korn cd example, 130
Korn shell (see ksh)
ksh (Korn shell), ix, 3
      compared to bash, 280
      public domain version of (pdksh), 281

L[ Top ]
l command, vi, 37, 41
LANG environment variable, 293
LC_ALL environment variable, 293
LC_COLLATE environment variable, 293
LC_CTYPE environment variable, 293
LC_MESSAGES environment variable, 293
LC_NUMERIC environment variable, 293
-le (integer comparison operator), 121
-le (less than or equal to test operator), 149
Learning the UNIX Operating System (Peek, Todino, Strang), x
length operator, 99
less than sign (<)
      << (bit-shift left operator), 147
      << (here-document), 163, 164-167
      <& (input redirection), 163
      <&- (input redirection), 163
      <> (input/output redirection), 163
      <= (less than or equal to operator), 148
      input redirection>, 162
      less than operator, 148
      redirecting input, 16
      string comparison operator, 114
let command, 150, 289
line continuation character, 23, 179
LINENO environment variable, 223, 233, 293
LINES environment variable, 76, 79
lists, in for statement, 122
lithist shell option, 62
loadable built-in functions, 304-308
local command, 88, 277, 289
local statement, 88
local variables, 87, 88, 146
logging in, files read during, 56
logging out
      CTRL-D for, disabling, 61
      files executed during, 57
logical operators, 112, 118, 148
login directory, 8
      (see also home directory)
login shell
      bash acting as, 254
      changing, 272
      installing bash as, 5, 272
logout command, 6, 289
loop variable, 122
looping construct
      arithmetic for statement, 155, 159-161
      for statement, 122-128
      until statement, 134-136
      while statement, 134-136
ls by dates example, 102
ls command, 10
      -a option, 10
      -F option, 58
      -l option, 10
      -R option, 125
ls example, 119
-lt (integer comparison operator), 121
-lt (less than test operator), 149

M[ Top ]
MACHTYPE environment variable, 293
macros, readline editing interface, 50
mail
      notification if already read, 62
      shell variables for, 67-69
MAIL environment variable, 68, 75, 293
mail example, 102
mail header lines, deleting, example, 165-167
MAIL shell variable, 68
MAILCHECK environment variable, 68, 293
MAILPATH environment variable, 68, 293
mailwarn shell option, 62
make command, 269
make install script, 270
make script, 269
make tests command, 271
make utility example, 188
MANIFEST file, bash archive, 268
mark-directories variable, readline, 52
mark-modified-lines variable, readline, 52
memory, size limitations, 255
menus, select statement for, 131
metacharacters, processing on command line, 180
meta-flag variable, readline, 52
MKS Toolkit (Mortice Kern Systems), 283
more command, 16
MS-DOS, GNU tools for, 283
multibyte character support, 270
multiple copies example, 216
multitasking, user-controlled, 197

N[ Top ]
N command, vi, 41
n command, vi, 41, 42
-N (file attribute operator), 117
-n (string comparison operator), 114
named pipes, 219
navigating directories, 9
ndu (disk space usage) example, 151-152
-ne (integer comparison operator), 121
-ne (not equal to test operator), 149
negating wildcards, 12
nested subshells, 218
NetPBM utility package, 116, 143
      pnmcat utility, 195
      pnmmargin utility, 143
      pnmnlfilt utility, 191
      pnmscale utility, 143
      pnmtext utility, 195
NEWS file, bash archive, 268
newsgroups for bash, 274
nice command, 20
noclobber shell option, 61
noglob shell option, 61
nohup command, 212
nounset shell option, 61
nroff test formatter, 269
-nt (file attribute operator), 118
numbered parameter names (see positional parameters)

O[ Top ]
O command, vi, 37
-O (file attribute operator), 117
-o (logical operator), 118
OLDPWD environment variable, 74, 293
one-dimensional arrays, 280
online help, 26
operators
      arithmetic operators, 147
      assignment, 150
      for conditions
            arithmetic operators, 121, 149
            file attribute operators, 117
            string comparison operators, 114
      logical operators, 148
      relational operators, 148
      string operators, 91-99
OPTARG environment variable, 142, 293
OPTERR environment variable, 293
OPTIND environment variable, 142, 293
options (see command-line options)
order of precedence
      for aliases, 84
      for commands, 84
      for functions, 84
      for scripts, 84
      in arithmetic expressions, 147
      overriding, 184
      POSIX, 279
O'Reilly contact information, xiv
orphan processes, 207
OSTYPE environment variable, 293
-ot (file attribute operator), 118
output
      standard, 14, 167, 188
      (see also I/O)
output files, as command-line options, 265
output redirection (see I/O redirection)
output-meta variable, readline, 52

P[ Top ]
P command, vi, 41
p command, vi, 41
parallelization, 216-217
parameters, positional (see positional parameters)
parameters (see arguments)
parent directory, 10
parentheses (())
      ((...)) (arithmetic test), 150, 266, 270
      command substitution, 100
      grouping conditional operators, 118
      in arithmetic expressions, 148
      nested subshells, 218
PATH environment variable, 71, 75, 258, 293
pathname expansion, 13
pathnames, 8
      expansion of, 182
      tilde (~) notation, 9
      wildcards for, 10
pattern matching operators, 95-98
      Bourne shell support, 277
      extended, 99
pbmtext utility, 195
PC platforms, shells for, 282
pdksh (Public Domain Korn shell), 281
Peek, Jerry (Learning the UNIX Operating System), x
percent sign (%)
      %? (job containing string), 200
      %% (job most recently put in background), 200
      %+ (job most recently put in background), 200
      %- (job second-most recently put in background), 200
      %% (pattern-matching operator), 96, 106
      job numbers, 199
      modulus operator, 147
      pattern-matching operator, 96
      printf format specifiers, 171, 173
      word designator, 48
permissions, 255
      default, 255
      for scripts, 82
PID (process ID), 198, 205
      determining, 204
      shell variable containing, 210
pipe character (^), 251, 276
pipe character (|), 162, 180
pipelines, 15, 16
      as coroutines, 214
      in command line processing, 180
      named pipes, 219
      system calls invoked by, 214
PIPESTATUS environment variable, 293
plus sign (+)
      ++ (increment operatro), 147
      addition operator, 147
      extended pattern-matching operator, 99
      printf flag, 172
      vi command, 41
      xtrace output, 223
PNM (Portable Anymap) format, 116, 143
pnmcat utility, 195
pnmmargin utility, NetPBM, 143
pnmnlfilt utility, NetPBM, 191
pnmscale utility, NetPBM, 143
point, emacs editing mode, 29
popd command, 270, 289
      Bourne shell not supporting, 277
      Korn not supporting, 281
      -N option, 155
      +n option, 152
popd function example, 103-106, 152-155
Portable Anymap (PNM) format, 116, 143
positional parameters, 86-88
      assignments using, 138
      command-line options and, 137-145
      in functions, 87
POSIX, bash using, 252, 254
POSIX regular expressions, 270
POSIX shell, 186, 275, 278-280
POSIXLY_CORRECT environment variable, 293
pound sign (see hash mark)
PPID environment variable, 294
Practical UNIX and Internet Security (Spafford, Garfinkel), 260
precedence (see order of precedence)
print command, Korn, 280
printer file filter example, 97
printf command, 170-173
      Bourne shell support, 277
      flags for, 172
      format specifiers for, 171, 173
priority of jobs, 20
privileged mode, 260
procedures (see functions)
process ID (PID), 198
      determining, 204
      shell variable containing, 210
process substitution, 219, 270
processes
      listing information about, 204-207
      parallelization of, 216-217
      simultaneous (coroutines), 214-217
      system resources used by, 215
      zombies or orphans, 207
      (see also signals)
profile, 56
      customizing, 254-258
      environment file and, 79
      environment variables in, 76
      ignoring, 254
      restricted, 259
.profile file, 57
programmable completion, 271, 309-312
programming language, choosing, 266
programming, shell (see scripts)
programs (see executable files)
prompt string customizations, 287
PROMPT_COMMAND environment variable, 293
prompting shell variables, 69-71
ps command, 204-207
      -a option, 205
      -ax option, 207
      -e option, 207
PS1 environment variable, 69, 257, 270, 293
PS2 environment variable, 69, 270, 293
PS3 environment variable, 69, 270, 293
PS4 environment variable, 69, 223, 270, 281, 294
pushd command, 270, 289
      Bourne shell not supporting, 277
      Korn not supporting, 281
      -N option, 155
      +n option, 152
pushd directory stack example, 132
pushd function example, 103-106, 109, 152-155
pwd command, 9, 289
PWD environment variable, 74, 75, 294

Q[ Top ]
q command, debugger, 236
question mark (?)
      debugger command, 236
      environment variable, 111, 290
      extended pattern-matching operator, 99
      vi command, 41
      wildcard, 11
QUIT signal, 202
quoting
      $@ and $* strings, 90
      * (asterisk) environment variable, 90
      @ (at sign) environment variable, 90
      alias definition, 59
      arithmetic expressions, 146
      command substitution, 100
      command-line processing and, 183
      guidelines for, 146
      in assignments, 150
      RETURN key, 23
      shell variables and, 63
      special characters, 21

R[ Top ]
R command, vi, 39
-r (file attribute operator), 117
Ramey, Chet, 4
RANDOM environment variable, 226, 294
range wildcard notation, 11
rbash command, 271
read command, 173-180, 289
      -a option, 179
      Bourne shell support, 277
      continuation character for, 179
      -e option, 179
      in while loop, 175
      -p option, 179
      -r option, 179
      reading lines from files, 174
      reading user input, 178
      -s option, 180
      -t option, 180
readline editing interface, 49-53
      conditionals, 51
      editing and history capabilities, 271
      functions, 50
      key bindings, 52
      macros, 50
      programmable completion and, 271
      startup file, 50-52
      variables, 51
readline variable, 28
README file, bash archive, 268, 269
readonly command, 146, 289
read-only variables, declaring, 145, 146
recursion, 125
recursion, infinite, 110
recursive aliases, 59, 182
regular files, 7
relational operators, 148, 149
relative pathname, 8
REPLY environment variable, 173, 233, 294
reserved words, list of, 288-290
resources (see books)
restricted shell, 253, 258, 271
return command, 289
RETURN key, 36
      CTRL-M equivalent for, 24
      quoting, 23
RETURN signal, 225, 228
return statement, 111, 277
return values of functions, 111
Reverse Polish Notation (RPN), 177, 194
root, 7
RPN (Reverse Polish Notation), 177, 194

S[ Top ]
s command, debugger, 236, 237
-s (file attribute operator), 117
scripts, 81-83
      comments in, 93, 261
      examples in archive for, 273
      execute permission for, 82
      functions in, 83-85
      good practices for, 261-266
      options for, guidelines, 263-265
      order of precedence for, 84
      potential problems with, 265
      running, 81
      running as background job, 82
      running in subshells, 82
      when not to use bash for, 266
      whitespace in, 265
SECOND environment variable, 74
SECONDS environment variable, 294
security, 258-260
      PATH variable and, 72
      privileged mode, 260
      restricted shell, 258
      suid bit and, 259
      system break-in scenario, 259
      Trojan horses, 260
sed command, 15
select statement, 131-134, 271
      Bourne shell not supporting, 277
      POSIX support, 279
selection sort example, 159-161
semicolon (;), 115
      statement separator, 115
      vi command, 43
set command, 289
      Bourne shell support, 276
      debugging options for, 222-224
      displaying settings of, 61
      emacs option, 28, 61
      functrace option, 228, 229
      ignoreeof option, 61
      -k option, 76
      noclobber option, 61, 164
      noexec option, 222, 224
      noglob option, 61
      nounset option, 61
      -o and +o options, 60
      options for, list of, 295
      options for, setting on bash command line, 253, 285
      pdksh support, 281
      posix option, 252
      privileged option, 260
      -r option, 259
      verbose option, 222
      vi option, 28, 61
      xtrace option, 222, 223
set user ID (suid) bit, 259
set wildcard construct, 11
sh (Bourne shell), 3
      compared to bash, 276
      compatibility with bash, 251
shared object compilation, 307
SHELL environment variable, 5, 76, 78, 258, 294
shell execution directive, 265
shell programming (see scripts)
shell scripts (see scripts)
shell variables, 62-64, 86
      arithmetic, 150-155
      attributes of, 145-146
      braces syntax for, 90
      built-in, 64-74
      built-in, list of, 290-294
      checking value of, 63
      command substitution in, 99-103
      containing process ID, 210
      converting to environment variables, 75
      declaring as arrays, 145
      declaring as function names, 145
      declaring as integers, 145, 146
      defining, 62
      deleting, 63
      displaying list of, with values, 145
      exporting to environment, 145, 146
      for command-line editing, 64-67
      for mail, 67-69
      for prompting, 69-71
      in arithmetic expressions, 146
      naming, 263, 265
      not supported by Bourne shell, 276
      positional parameters, 86-88
      quoting, 63
      reading values into, 173-180
      read-only, 145, 146
      string operators for, 91-99
      using in commands, 63
      value of, as name of another variable, 194
SHELLOPTS environment variable, 294
shells, ix, 1, 2
      Bourne (sh), 3, 251, 276
      C shell (csh), x, 3
      determining which shell is in use, 5
      history of, 3
      IEEE POSIX 1003.2, 275, 278-280
      Korn (ksh), ix, 3, 280
      login shell, 5, 254, 272
      on PC platforms, 282
      Public Domain Korn (pdksh), 281
      restricted, 253, 258, 271
      standard shell, ix, 251
      subshells, 217-219
      Tenex C (tcsh), ix
      zsh, 282
      (see also bash)
shift command, 138-140, 289
SHLVL environment variable, 294
shopt command, 61
      Bourne shell support, 276
      extdebug option, 229
      options for, list of, 297-298
      options on bash command line for, 253
show-all-if-ambiguous variable, readline, 52
signals, 201-207
      control-key signals, 202
      fake, 224-229
      ignoring, 212
      kill command, 203
      listing, 202
      POSIX support, 279
      trapping, 207-214
single quotes (')
      around special characters, 21
      command line processing of, 183
      enclosing RETURN, 23
      in alias definition, 59
      when to use, 100, 147
slash (/)
      // (pattern-matching and replacement operator), 96
      division operator, 147
      in restricted shell, 258
      pattern-matching and replacement operator, 96
      vi command, 41
soft limits, 257
sort command, 15, 238
      -n option, 92
      -r option, 92
source command, 56, 81
Spafford, Gene (Practical UNIX and Internet Security), 260
special characters, 20-25
      backslash-escaping, 22
      control keys, 24
      quoting, 21
Stallman, Richard, 4
standard error, 14
      file descriptor for, 167
      prompts sent to, 178
      saving to a file, 167
standard error and output file example, 167, 188
standard input, 14
      file descriptor for, 167
      reading commands from, 253
standard output, 14
      file descriptor for, 167
      saving to a file, 167, 188
standard shell, ix, 251
statement separator, 115
status (see exit status of commands)
stepping, in debugger, 230, 236, 237
Strang, John (Learning the UNIX Operating System), x
string comparisons, 113-117
string I/O, 168-180
string operators, 91-99
      comparison, 114
      extended pattern matching operators, 99
      length operator, 99
      pattern matching operators, 95-98
      substitution operators, 91-95
stty command, 24, 202
subprocesses
      environment settings known to, 75-79
      (see also background jobs)
subroutines (see functions)
subshells, 217-219
      environment variables in, 83
      inheritance of, 218
      nested, 218
      scripts running in, 82
substitution operators, 91-95
substring expansion, 92
suid (set user ID) bit, 259
suspend command, 289
switch statement, 128
system administration, 251
      bash command options for, 253
      configuring and building bash, 269-271
      customizing environment, 254-258
      global customization, 257
      installing bash as login shell, 272
      installing bash as standard shell, 251
      obtaining bash, 267
      switching bash to POSIX mode, 252
      unpacking bash archive, 268
system calls, pipelines invoking, 214
System V, ps command, 206

T[ Top ]
T command, vi, 43
t command, vi, 43
TAB command, emacs, 33
tar utility, 268
tcsh (Tenex C shell), ix
tee command, 168
temporary files, 211
Tenex C shell (see tcsh)
TERM environment variable, 75, 76, 77, 174
TERM (terminate) signal, 203
terminal stop (TSTP) signal, 202
terminate (TERM) signal, 203
terminfo database, 77
test command, 113, 289
test operators, list of, 294-295
text files (see regular files)
textual completion, 309-312
      emacs editing mode, 33-35
      programmable, 271
      vi editing mode, 44
thrashing, 216
tilde (~)
      bitwise not operator, 148
      home directory, 182
      in pathnames, 9, 276
      invert case, vi, 45
      username completion, 34
time command, 270
time stamp for command history, 66
TIMEFORMAT environment variable, 294
times command, 290
TMOUT environment variable, 257, 294
Todino, Grace (Learning the UNIX Operating System), x
tokens, processing on command line, 180
tr command, 15
tracing, execution, 241
trap command, 207-214, 290
      - argument, 213
      debugging with, 225
      fake signals and, 224-229
      ignoring signals using, 212
      with exit command, 211
traps
      fake signals for, 224
      functions and, 209
      resetting, 213
tree, 7
troff format, 269
Trojan horses, protecting against, 260
true command, 208
TSTP (terminal stop) signal, 202
tty built-in, 304
type command, 72, 85, 290
      -a option, 85
      Bourne shell not supporting, 277
      -f option, 85
      Korn not supporting, 280
      -P option, 85
      -p option, 85
      -t option, 85
typed variables, 145-146
typeset command, 145, 290

U[ Top ]
u command, vi, 40
UID environment variable, 294
ulimit command, 255-257, 277, 290
umask command, 255, 277, 290
unalias command, 60, 290
UNIX shells (see shells)
unset command, 63, 84, 159, 290
until statement, 134-136
user input, reading, 178
user interfaces, 2
user-controlled multitasking, 197
username completion, emacs editing mode, 34
UWIN package (AT&T), 284

V[ Top ]
variables
      in cd command, 62
      undefined, not allowing, 61
variables, environment (see environment variables)
variables, shell (see shell variables)
version of bash, determining, 74, 254
versions of bash, ix, 4
vertical bar (|)
      || (logical or operator), 112, 118, 149
      bitwise or operator, 147
      extended pattern matching, 99
      in case statement, 129
      pipe, 16, 162, 180
      vi command, 44
vi editing mode, 36-45
      character-finding commands, 43
      commands conflicting with terminal interface control keys, 28
      commands for, list of, 302
      control mode commands, 37
      deletion commands, 40
      history list, 41-42
      input mode commands, 39
      selecting, 28, 61
      textual completion, 44
      when to use, 53
vi shell option, 61
visible-stats variable, readline, 52
VISUAL environment variable, 75

W[ Top ]
W command, vi, 37, 38
w command, vi, 37, 38
-w (file attribute operator), 117
wait command, 215, 290
whence command, 6, 280
whereis command, 6
which command, 6
while statement, 134-136
      getopts command used with, 141-142
      with read command, 175
whitespace in scripts, 265
who command, 102
wildcard expansion, 12
wildcards
      in aliases, 59
      in filenames, 10-13
      not expanding, 61
word designators, 48
words, in command, 2
working directory, 8, 9, 74

X[ Top ]
x command, debugger, 236
X command, vi, 40
x command, vi, 40
-x (file attribute operator), 117

Y[ Top ]
y command, vi, 41

Z[ Top ]
-z (string comparison operator), 114
zero (0) printf flag, 172
zero (0) word designator, 48
zombie processes, 207
zsh shell, 282

	

Zurück zu Learning the bash Shell


Themen

Buchreihen

Special Interest

International Sites

O'Reilly China O'Reilly France O'Reilly USA O'Reilly Japan O'Reilly Taiwan