Classic Shell Scripting
Hidden Commands that Unlock the Power of Unix

First Edition Mai 2005
ISBN 978-0-596-00595-5
Seiten 558
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 ],
& (ampersand)
      &= (assignment operator), 119, 401
      && (logical AND operator), 118, 123, 230, 401
      beginning HTML entities, 96
      bitwise AND operator, 118, 401
      expr operator, 160
      in sed replacement text, 50
      preceding file descriptor, 146
      run in background, 13
* (asterisk)
      ** (arithmetic operator), 230, 400, 401
      **= (assignment operator), 230
      *= (assignment operator), 119, 230, 401
      arithmetic operator, 118, 230, 401
      expr operator, 160
      in regular expressions, 34, 40
      variable, 117
      wildcard, 153
@ (at sign) variable, 117
` (backquote)
      `...` (command substitution), 156
\ (backslash)
      \(...\) (backreferences), 35, 39
      \\ (escape sequence), 17, 148
      \< (in regular expressions), 46
      \> (in regular expressions), 46
      \{...\} (interval expressions), 34, 40
      in bracket expressions in EREs, 42
      in regular expressions, 34
      line continuation character, 142
      line continuation character, awk, 226
      literal interpretation, 161
      preceding echo escape sequences, 16
      preceding printf escape sequences, 148
{...} (braces)
      brace expansion, 395
      code blocks, 167, 486
      compound statements, awk, 244
      in Extended Regular Expressions, 43
      in regular expressions, 35
      positional parameters greater than 9, 115
^ (caret)
      ^= (assignment operator), 119, 230, 401
      arithmetic operator, 230
      bitwise exclusive OR operator, 118, 401
      in Basic Regular Expressions, 37
      in regular expressions, 34, 41, 45, 484
: (colon)
      :+ (substitution operator), 114
      :- (substitution operator), 113
      := (substitution operator), 113
      :? (substitution operator), 114
      command, 123
      expr operator, 160
      special built-in command, 168
, (comma)
      sequential evaluation, 401
$ (dollar sign)
      $((...)) (arithmetic expansion), 118-120, 485
      $(...) (command substitution), 156
      ${...} (parameter expansion), 113
      "$*" (variable), 116
      "$@" (variable), 116
      $# (variable), 115
      $$ (variable), 118, 276, 355
      $* (variable), 116
      $- (variable), 175
      $@ (variable), 116
$ (dollar sign) (continued)
      in regular expressions, 34, 41, 45, 484
      preceding field values in awk, 63
      preceding variables, 15, 113
      variable, 117
. (dot)
      command, 172, 473
      directory, 445
      hidden files preceded by, 155
      in Basic Regular Expressions, 37
      in filenames, 154
      in regular expressions, 34
      preceding hidden files, 270
      special built-in command, 168
.. (dot dot) directory, 445
"..." (double quotes)
      enclosing string constants, awk, 226
      grouping text, 162
... (ellipses), inserting in troff markup, 431
= (equal sign)
      == (comparison operator), 118, 230, 401
      == (test expression), 393
      assigning values to variables, 15
      assignment operator, 119, 230, 401
      expr operator, 160
      test expression, 125, 393
! (exclamation mark)
      != (comparison operator), 118, 230, 401
      != (expr operator), 160
      != (test expression), 125, 393
      !~ (matches operator, awk), 228
      arithmetic operator, 118, 230, 401
      in wildcard set, 153, 154
      logical NOT operator, 122
      variable, 117
# (hash mark)
      ## (pattern-matching operator), 114
      #! (specifying interpreter in shell script), 10-12
      pattern-matching operator, 114
      preceding comments, 24
      preceding comments, awk, 226
      prefixing temporary backup file name, 470
      printf flag, 151
      string-length operator, 115
      variable, 117
- (hyphen)
      -- (arithmetic operator), 118, 230, 400, 401
      -= (assignment operator), 119, 230, 401
      -- (end of options), 13
      arithmetic operator, 118, 230, 401
      as bare option, 12
      expr operator, 160
      in filenames, 440
      preceding command options, 13
      preceding file type in listing, 466
      printf flag, 151
      variable, 117
< (left angle bracket)
      <!-- ... --> (HTML comments), 96
      <<= (assignment operator), 119, 401
      <= (comparison operator), 118, 230, 401
      <= (expr operator), 160
      << (here document), 98, 143
      <<- (here document, leading tabs removed), 144
      <<< (here strings), 400
      <> (open file for reading and writing), 144
      changing standard input, 19
      comparison operator, 118, 230, 401
      expr operator, 160
      test expression, 393
(...) (parentheses)
      ((...)) (arithmetic command), 399
      grouping arithmetic expressions, 119
      grouping, expr expressions, 160
      in Extended Regular Expressions, 44
      in regular expressions, 35
      subshell, 167
% (percent sign)
      %= (assignment operator), 119, 230, 401
      %% (format specifier), 149
      %% (format specifier, awk), 261
      %% (pattern-matching operator), 115
      arithmetic operator, 118, 230, 401
      expr operator, 160
      pattern-matching operator, 114
      preceding format specifications, 18
      preceding printf format specifiers, 149
+ (plus sign)
      ++ (arithmetic operator), 118, 230, 400, 401
      += (assignment operator), 119, 230, 401
      arithmetic operator, 118, 230, 401
      expr operator, 160
      in Extended Regular Expressions, 43
      in regular expressions, 35
      in trace output, 24
      printf flag, 151
? (question mark)
      ?: (conditional expression), 119, 230, 401
      in Extended Regular Expressions, 43
      in regular expressions, 35
      variable, 117, 120
      wildcard, 153
> (right angle bracket)
      >> (appending to standard output), 19
      >> (bit-shift right operator), 118, 401
      >> (output redirection, awk), 251
      >>= (assignment operator), 119, 401
      >= (comparison operator), 118, 230, 401
      >= (expr operator), 160
      >| (redirect output overriding noclobber), 143, 145
      changing standard output, 19
      comparison operator, 118, 230, 401
      expr operator, 160
      output redirection, awk, 251
      test expression, 393
; (semicolon)
      ending HTML entities, 96
      separating commands, 13
      separating statements, awk, 240, 244
'...' (single quotes), literal interpretation, 161
/ (slash)
      /= (assignment operator), 119, 230, 401
      arithmetic operator, 118, 230, 401
      expr operator, 160
      forbidden in filenames, 439
      in pathname, 445
      root directory, 443
[...] (square brackets)
      [: ... :] (character classes), 36, 38
      [. ... .] (collating symbols), 36, 38
      [= ... =] (equivalence classes), 36, 38
      [ ... ] (test command variant form), 124
      [[...]] (extended test facility), 392-393
      array indices, awk, 233
      in regular expressions, 34, 486
      wildcard set, 153
~ (tilde)
      ~- ($OLDPWD tilde expansion), 399
      ~+ ($PWD tilde expansion), 399
      arithmetic operator, 118, 401
      in temporary backup file name, 470
      matches operator, awk, 228
      tilde expansion, 152, 399, 505
| (vertical bar)
      |= (assignment operator), 119, 401
      || (logical OR operator), 118, 123, 230, 401
      alternation operator, 43, 484
      bitwise OR operator, 118, 401
      expr operator, 160
      in regular expressions, 35
      pipe symbol, 10

Symbols[ Top ]
< (left angle bracket)
      << (arithmetic operator), 118, 401

Numbers[ Top ]
$0 ... $NF field references, awk, 238
\0 escape sequence, 17, 148
0 exit status, 121
0 printf flag, 151
0 variable, 117, 406
0...9 file descriptors, 145-147
.1 file extension, 469
1-125 exit statuses, 121
126 exit status, 121
127 exit status, 121
128 exit status, 121
129 or higher exit statuses, 121
$1...$9 (see positional parameters)

A[ Top ]
\a escape sequence, 16, 148
.a file extension, 469
-a logical AND, test expression, 126
-a shell option, 174
-a test expression, 392
ABRT signal, 361
access control lists (ACLs), 460, 484
access time for files, 286, 460-461
accounting, process, 372
ACLs (access control lists), 460, 484
actions, awk, 225, 239
addition operator, 118, 401
Adobe PDF (Portable Document Format), 80, 82
Adobe PostScript, 80, 82
alert character, escape sequence for, 16, 148
alias command, 168, 171
aliases
      defining, 168, 171
      finding location of, 280
      removing, 169, 171
allexport shell option, 174
alternation operator, 43, 45, 484
American National Standards Institute (ANSI), 484
American Standard Code for Information Interchange (ASCII), 438, 484
American Standards Association (ASA), 484
ampersand (&)
      &= (assignment operator), 119, 401
      && (logical AND operator), 118, 123, 230, 401
      beginning HTML entities, 96
      bitwise AND operator, 118, 401
      expr operator, 160
      in sed replacement text, 50
      preceding file descriptor, 146
      run in background, 13
anchors, 41, 42, 45, 484
ANSI (American National Standards Institute), 484
archives, InfoZip format for, 204
ARGC variable, awk, 234
ARG_MAX variable, 294
arguments
      all, representing, 116
      awk arguments, 234
      for current process, 117
      for options, 13
      function arguments, 136
      maximum length of, 294
      number of, 115, 117
      passed by reference, 486
      passed by value, 486
      shifting to the left, 116, 132, 169, 474
      validating, 414
      wildcard expansion of, 353
      (see also positional parameters)
ARGV variable, awk, 234
arithmetic commands, 399
arithmetic expansion, 109, 118-120, 485
arithmetic for loop, 399
arithmetic operators, 118, 230, 400, 401
arrays
      array variables, 485
      array variables, awk, 233-234
      associative arrays, 233, 485
      awk arrays, 247
      indexed arrays, 396-399
ASA (American Standards Association), 484
ASCII (American Standard Code for Information Interchange), 438, 484
aspell command, 329-330, 347
assignment operators, 119, 230, 401
associative arrays, 233, 485
asterisk (*)
      ** (arithmetic operator), 230, 400, 401
      **= (assignment operator), 230
      *= (assignment operator), 119, 230, 401
      arithmetic operator, 118, 230, 401
      expr operator, 160
      in regular expressions, 34, 40
      variable, 117
      wildcard, 153
at command, 374, 476
at sign (@) variable, 117
at.allow file, 374
atan2() function, awk, 264
at.deny file, 374
AT&T, UWIN package, xxii
audit trails, 414
.awk file extension, 469
awk interpreter, 62-65
      command line arguments, accessing, 234
      command line for, 224
      efficiency of, 349
      environment variables, accessing, 236
      examples, one-line programs, 240-243
      extracting first lines, 83
      -F option, 63, 224
      -f option, 224
      for field extraction, 89-94
      free implementations of, 224
      input from files, 224
      input from standard input, 224, 225
      interval expressions support, 48
      regular expressions support, 47, 228, 238
      tag list example using, 106
awk language, 223-226, 474
      -- option, 224
      actions, 225, 239
      array variables, 233-234
      arrays, membership testing, 247
      assignment operators, 231
      BEGIN pattern, 64, 226, 239
      built-in variables, 232
      comments, 226
      compound statements, 244
      conditional execution, 244
      control flow, 248
      END pattern, 64, 226, 239
      external programs, running, 251
      field separators, 224, 237
      fields in, 62, 225, 238
      floating-point arithmetic, 229
      global variables in functions, 253
      iterative execution, 245-247
      line continuation character, 226
      local variables in functions, 253
      logical operators, 231
      looping, 245-247
      numbers, 228-232
      numbers, converting to strings, 227
      numeric functions, 264-266
      numeric operators, 230
      output redirection, 250
      patterns, 225, 238
      printing lines, 64
      record separators, 72, 236
      records in, 62, 225, 236
      recursion, 254
      spellchecking implemented with, 331-343, 348
      statements, separation of, 244
      string constants, 226
      string functions, 255-264
      string operators, 227
      strings
            concatenating, 227
            converting to numbers, 228
      user-controlled input, 249-250
      user-defined functions, 252-255
      -v option, 224, 225
      variables, scalar, 232
      whitespace, 226
awka translator, 224

B[ Top ]
.B command, troff, 426
\b escape sequence, 16, 148
%b format specifier, 149
b, preceding block device in listing, 466
-b shell option, 174
-b test expression, 125, 392
background processes, 485
      process ID of last background command, 117
      running, 356
backquote (`)
      `...` (command substitution), 156
backreferences, 35, 485
      in Basic Regular Expressions, 39
      in regular expressions, 42
      in sed program, 50
      not supported in Extended Regular Expressions, 42
backslash (\)
      \(...\) (backreferences), 35, 39
      \\ (escape sequence), 17, 148
      \< (in regular expressions), 46
      \> (in regular expressions), 46
      \{...\} (interval expressions), 34, 40
      in bracket expressions in EREs, 42
      in regular expressions, 34
      line continuation character, 142, 226
      literal interpretation, 161
      preceding echo escape sequences, 16
      preceding printf escape sequences, 148
backslash escaping, 161
backspace, escape sequence for, 16, 148
backup files, temporary, 470
basename, 485
basename command, 181, 474
bash (Bourne Again Shell), 473
      differences from ksh93, 381-385
      downloading, 402-403
      shopt command, 385-389
      startup and termination, 408-410
BASH_ENV variable, 409
Basic Regular Expressions (BREs), 30, 37-42, 485
      backreferences in, 35, 39
      metacharacters for, 34
      programs using, 46-48
      (see also grep command)
batch command, 374, 476
BEGIN pattern, awk, 64, 226, 239
Bell Labs awk, 224
Bell Telephone Laboratories, 1
Bentley, Jon, word list challenge by, 102
bg command, 168, 172
.BI command, troff, 428
bin directories, 414, 444
binary files, 442
birthday paradox, 485
"bit bucket" file, 21
bit-shift left operator, 118, 401
bit-shift right operator, 118, 401
bitwise AND operator, 118, 401
bitwise exclusive OR operator, 118, 401
bitwise negation operator, 118, 401
bitwise OR operator, 118, 401
black box, 8
block device
      preceded by b in listing, 466
      test expression for, 125
block sizes, 464
BODY object, HTML, 96
Bourne-Again Shell (see bash)
Bourne shell (see sh)
.BR command, troff, 428
brace expansion, 395
braces ({...})
      brace expansion, 395
      code blocks, 167, 486
      compound statements, 244
      in Extended Regular Expressions, 43
      in regular expressions, 35
      positional parameters greater than 9, 115
bracket expressions, 34, 42, 486
      in Basic Regular Expressions, 37
      in Extended Regular Expressions, 42, 43, 45
      internationalization and localization features for, 35-36
brackets (see square brackets)
break command, 131, 168, 473
break statement, awk, 246, 248
BREs (see Basic Regular Expressions)
bubble sort algorithm, 74
building software packages, automating procedure for, 192-222
built-in commands, 13, 168-172, 486
built-in variables, in awk, 232
bullets, inserting in troff markup, 431
bunzip2 command, 475
.bz2 file extension, 469
bzip2 command, 475

C[ Top ]
\c escape sequence, 16, 148
.C file extension, 470
.c file extension, 469
%c format specifier, 149, 261
c, preceding character device in listing, 466
-C shell option, 174
-C test expression, 392
-c test expression, 125, 392
call stack, 255, 486
cancel command, 79
caret (^)
      ^= (assignment operator), 119, 230, 401
      arithmetic operator, 230
      bitwise exclusive OR operator, 118, 401
      in Basic Regular Expressions), 37
      in regular expressions, 34, 41, 45, 484
carriage return, escape sequence for, 16, 148
case conversion
      awk, 256
      tr command, 20
case sensitivity, in filenames, 440
case statement, 129
      optional matching parentheses, 400
      path searching example using, 181-183
      software build example using, 197
cat command, 474
      awk implementation of, 241
      tag list example using, 105
catman program, 436
.cc file extension, 470
cd command, 168, 473
CD-ROMs, 438
character classes
      in Basic Regular Expressions, 38
      in regular expressions, 36, 42
character device
      preceded by c in listing, 466
      test expression for, 125
character sets, 438
characters
      counting, 10, 77
      transliterating, 20
      (see also metacharacters; special characters)
checknr command, 435
checksum command, 301
chgrp command, 453, 475
chmod command, 10, 454, 467, 475
chown command, 453, 475
ci command, 477
cksum command, 301, 475
close() function, awk, 250
closedir() function, 448
cmp command, 299, 474
co command, 477
code blocks, 167, 486
code examples in book, using, xxi
code pages, 439, 487
col command, 435
collating symbols, 487
      in Basic Regular Expressions, 38
      in regular expressions, 36, 42
colon (:)
      :+ (substitution operator), 114
      :- (substitution operator), 113
      := (substitution operator), 113
      :? (substitution operator), 114
      command, 123
      expr operator, 160
      special built-in command, 168
comm command, 326, 475
comma (,)
      sequential evaluation, 401
command command, 169, 170, 171, 474
command history
      disabling for functions, 174, 385
      enabling, 385
      interactive use of, 169
      sh shell not supporting, 408
command line arguments (see arguments)
command line options, 13, 133, 495
command substitution, 155-161, 487
      expr command and, 159-161
      mailing list example of, 157-159
      sed command and, 157
command-line editing, vi-style editing for, 174
commands, 12-14
      alias command, 168, 171
      aspell command, 329-330, 347
      at command, 374, 476
      basename command, 181, 474
      batch command, 374, 476
      bg command, 168, 172
      break command, 131, 168, 473
      built-in, 168-172
      bunzip2 command, 475
      bzip2 command, 475
      cancel command, 79
      cat command, 474
      cd command, 168, 473
      changing environment variable for duration of, 111
      checking for syntax errors, 174
      checknr command, 435
      checksum command, 301
      chgrp command, 453, 475
      chmod command, 10, 454, 467, 475
      chown command, 453, 475
      ci command, 477
      cksum command, 301, 475
      cmp command, 299, 474
      co command, 477
      col command, 435
      colon (:) command, 123, 168
      comm command, 326, 475
      command command, 169, 170, 171, 474
      continue command, 131, 169, 474
      cp command, 475
      cron command, 377, 476
      crontab command, 375-377, 476
      cut command, 58, 474
      date command, 474
      dd command, 85, 474
      deroff command, 435
      df command, 295-297, 464, 475
      diff command, 299, 475
      diff3 command, 300
      dirname command, 201, 474
      dot (.) command, 168, 172
      du command, 297-299, 464, 475
      echo command, 15, 16, 267, 382, 475
      egrep command, 5, 30, 475
      env command, 111, 474
      eval command, 166, 169, 415, 474
      evaluation order of, 162-166
      exec command, 146, 169, 474
      exit command, 121, 169, 474
      exit status of, 117
      expand and print before executing, 174
      expand command, 475
      export command, 110, 474
      expr command, 159-161
      false command, 169, 474
      fc command, 169, 172
      fg command, 169, 172
      fgrep command, 31, 475
      file command, 85, 475
      files, list of, 475
      find command, 280-291, 464, 475
      finding location of, in PATH, 280
      fmt command, 76, 475
      fuser command, 476
      getconf command, 444
      getopts command, 133, 169, 474
      getpubkey command, 306
      gpg command, 306
      grep command, 5, 23, 30, 32, 475
      groff command, 435
      gr_osview command, 356
      grouping, 167
      gunzip command, 475
      gzip command, 475
      head command, 83, 476
      iconv command, 475
      id command, 474
      info command, 477
      iostat command, 356
      ispell command, 329-330, 347
      jobs command, 169, 172
      join command, 60, 475
      kill command, 169, 172, 360-363, 476
      ktrace command, 368
      less command, 475
      let command, 399
      list of, 473-477
      locale command, 26, 477
commands (continued)
      locate command, 279, 476
      logger command, 414, 477
      long lists of arguments to, 293
      lp command, 79, 477
      lpq command, 79, 477
      lpr command, 79, 477
      lprm command, 79
      lpstat command, 79
      ls command, 268-272, 463, 476
      mail command, 199, 477
      mailx command, 199
      make command, 477
      man command, 477
      maximum length of, with arguments, 294
      md5 command, 301
      md5sum command, 301, 476
      mkdir command, 476
      mktemp command, 118, 276, 476
      monitor command, 356
      more command, 475
      mount command, 445
      mpstat command, 356
      netstat command, 356
      newgrp command, 169
      nfsstat command, 356
      nice command, 352, 476
      nroff command, 435
      od command, 85, 269, 476
      osview command, 356
      par command, 368
      patch command, 300, 476
      perfmeter command, 356
      pgp command, 306
      pgpgpg command, 306
      pgrep command, 363
      pkill command, 363
      pr command, 80-82, 475
      printf command, 17, 147-152, 475
      printing before executing, 174
      processes, list of, 476
      procinfo command, 356
      proctool command, 356
      prompt string for, 118
      prstat command, 356
      ps command, 354-360, 476
      pstat command, 356
      ptree command, 356
      pwd command, 169, 476
      rcp command, 196
      rcs command, 477
      rcs, list of, 477
      rcsdiff command, 477
      read command, 140-143, 169, 474
      reading without executing, 174
      readonly command, 110, 169, 474
      renice command, 352, 476
      return command, 136, 169, 474
      rlog command, 477
      rm command, 476
      rmdir command, 476
      rsh command, 196
      running in separate process, 167
      sar command, 356
      scp command, 196, 477
      sdtperfmeter command, 356
      search path, 169
      search path for, 118
      section number references in, xx
      sed command, 48-56, 83, 475
      set command, 25, 116, 143, 169, 172-175, 383-385, 474
      setting environment variable for duration of, 111
      shift command, 116, 132, 169, 474
      shopt command, 385-389
      show command, 155
      sleep command, 373, 476
      sort command, 67-75, 475
      spell command, 325, 327, 347, 475
      ssh command, 196, 477
      stat command, 273, 466
      strace command, 368
      strings command, 85, 476
      stty command, 474
      su command, 418
      sum command, 301
      syslog command, 414
      systat command, 356
      tail command, 84, 476
      tar command, 476
      tee command, 475
      test command, 124-128, 474
      text manipulation, list of, 474
      tgrind command, 83
      times command, 169, 172
      top command, 355, 357, 476
      touch command, 273-274, 461, 476
      tr command, 20, 475
      trace command, 368
      trap command, 169, 276, 364-367, 400, 474
      troff command, 82, 435
      true command, 169, 474
      truss command, 368
      type command, 280, 474
      types of, 13
      typeset command, 474
      typo command, 347
      ulimit command, 452, 474
      umask command, 169, 172, 455, 467, 476
      umount command, 445
      unalias command, 169, 171
      unexpand command, 475
      uniq command, 75, 475
      unset command, 111-113, 169, 474
      unsetting environment variable for duration of, 111
      unzip command, 476
      updatedb command, 279
      uptime command, 352, 356, 477
      vgrind command, 83
      vmstat command, 356
      vmubc command, 356
      w command, 356
      wait command, 169, 172, 356, 476
      wc command, 10, 77, 475
      wget command, 306
      where shell searches for, 22
      who command, 9, 474
      xargs command, 293, 476
      xcpustate command, 356
      xload command, 356
      xperfmon command, 356
      ypcat command, 453
      ypmatch command, 453
      zip command, 476
comments, 24
      awk language, 226
      HTML, 96
      troff, 425
Common UNIX Printing System (see CUPS)
comparison operators, 118, 230, 401
compiled languages, 8
compound statements, 244, 487
compressed archive files, software packages distributed in, 192
Computing Sciences Research Center, Bell Telephone Laboratories, 1
Concurrent Versions System (cvs), 470, 477, 487
conditional execution
      awk, 244
      shell script, 121-122
conditional expression operator, 119, 230, 401
config.h file, 192
configure script, with software packages, 192
CONT signal, 361
contact information, xxiii
context switches, 352, 487
continue command, 131, 169, 474
continue statement, awk, 246, 248
controlling terminal, 353, 487
conventions used in this book, xix
Coordinated Universal Time (UTC), 460, 488
core dump, 488
coreutils package, stable sort option in, 75
cos() function, awk, 264
cp command, 475
.cpp file extension, 470
cracker, 488
cron command, 377, 476
cron.allow file, 377
cron.deny file, 377
crontab command, 375-377, 476
crossword puzzles, pattern matching dictionary for, 100-101
cryptography, public-key, 303, 498
Ctrl key, xix
Ctrl-D, disabling, 174
CUPS (Common UNIX Printing System), 80
current working directory, 118, 488
      adding to PATH, 23
      not included in PATH, 413
cut command, 58, 474
cvs (Concurrent Versions System), 470, 477, 487
.cxx file extension, 470
cygwin environment (Cygnus Consulting), xxi

D[ Top ]
%d format specifier, 149, 150, 261
d, preceding directory in listing, 466
-d test expression, 125, 392
daemon, 488
dash (see hyphen)
data sink (see standard output)
data source (see standard input)
databases, 95
data-driven programming model, 238
date command, 474
dd command, 85, 474
DEBUG trap, 383
decrement operator, 118, 230, 400, 401
delete statement, awk, 233
delimiter, 488
Delorie, D.J., DJGPP suite, xxii
deroff command, 435
dev directory, 450
device driver, 488
devices
      as files, 450
      block devices, 125, 466
      random pseudodevices, 277
/dev/null file, 21
/dev/random pseudodevice, 277
/dev/tty file, 21
/dev/urandom pseudodevice, 277
df command, 295-297, 464, 475
dictionary, spelling, 100
diff command, 299, 475
diff3 command, 300
digital signature, 303-307, 488
directories, 489
      adding to PATH, 22
      bin directory, 414, 444
      dev directory, 450
      dot (.) directory, 445
      dot dot (..) directory, 445
      listing, 271
      number of files in, 443
      permissions for, 458-460
      preceded by d in listing, 466
      reading and writing, 448
      root directory, 443, 501
      searchable, test expression for, 125
      test expression for, 125
      usr directory, 444
directories file for customization, 193
dirname command, 201, 474
disk quotas, 452
disk usage, determining, 464
division operator, 118, 401
DJGPP suite, xxii
do statement, awk, 245-247
DocBook/XML, 489
documentation (see manual pages)
dollar sign ($)
      $((...)) (arithmetic expansion), 118-120, 485
      $(...) (command substitution), 156
      ${...} (parameter expansion), 113
      "$*" (variable), 116
      "$@" (variable), 116
      $# (variable), 115
      $$ (variable), 118, 276, 355
      $* (variable), 116
      $- (variable), 175
      $@ (variable), 116
      in regular expressions, 34, 41, 45, 484
      preceding field values in awk, 63
      preceding variables, 15, 113
      variable, 117
dosmacux package, 442
dot (.)
      command, 172, 473
      directory, 445
      hidden files preceded by, 155
      in Basic Regular Expressions, 37
      in filenames, 154
      in regular expressions, 34
      preceding hidden files, 270
      special built-in command, 168
dot dot (..) directory, 445
double quotes ("...")
      enclosing string constants, awk, 226
      grouping text, 162
du command, 297-299, 464, 475
DVDs, 438

E[ Top ]
%E format specifier, 149, 150
%e format specifier, 149, 150, 261
-e shell option, 174
-e test expression, 125, 392
EBCDIC (Extended Binary Coded Decimal Interchange Code), 439, 489
echo command, 15, 16, 267, 382, 475
ed program, regular expressions used by, 47
EDITOR variable, 375
-ef test expression, 393
egrep command, 5, 30, 475
      regular expressions used by, 47
      tag list example using, 106
ellipses (...), inserting in troff markup, 431
embedded computer systems, 437, 489
empty field, 57
empty files, 125, 273, 442
empty (null) values, 14
encryption
      of data, 468
      public-key cryptography, 303
      secure shell software using, 468
END pattern, awk, 64, 226, 239
endgrent() function, 453
endpwent() function, 453
entity, 489
env command, 111, 210, 474
ENV file, 408
ENV variable, 117
ENVIRON variable, awk, 236
environment, 489
      adding variables to, 110
      printing, 111
environment variables, 489
      accessing in awk, 236
      changing for specific program, 111
      for locale, 26-28
      setting, 110
      unsetting, 111-113
epoch, 274, 460, 489
.eps file extension, 470
-eq test expression, 125, 393
equal operator, 118, 230, 401
equal sign (=)
      == (comparison operator), 118, 230, 401
      == (test expression), 393
      assigning values to variables, 15
      assignment operator, 119, 230, 401
      expr operator, 160
      test expression, 125, 393
equivalence classes
      in Basic Regular Expressions, 38
      in regular expressions, 36, 42
EREs (see Extended Regular Expressions)
errexit shell option, 174
errors
      checking error status, 414
      (see also exit status; standard error)
escape mechanism, 489
escape sequences
      for echo command, 16
      for printf command, 148
eval command, 166, 169, 474
      not using on user input, 415
      path search example using, 184
evaluation order of commands, 162-166
examples (see code examples in book, using)
exclamation mark (!)
      != (comparison operator), 118, 230, 401
      != (expr operator), 160
      != (test expression), 125, 393
      !~ (matches operator, awk), 228
      arithmetic operator, 118, 230, 401
      in wildcard set, 153, 154
      logical NOT operator, 122
      variable, 117
.exe file extension, 470
exec command, 146, 169, 474
executable file, test expression for, 125
execute permission, 10, 453, 455-458, 489
execution tracing, 24, 118
execve() function, 352
exit command, 121, 169, 474
exit() function, 352, 360
exit statement, awk, 249
exit status, 490
      if statement and, 121-122
      logical operators and, 122
      of previous command, 117
      of test command, 124-128
      passing back to caller, 121
      values of, 120
exp() function, awk, 264
expand command, 475
expansion, 490
      arithmetic expansion, 109, 118-120, 485
      brace expansion, 395
      parameter expansion, 113-118, 496
      pathname expansion, 496
      tilde expansion, 152, 399, 505
      wildcard expansion, 174, 353, 415
expansion operators, 113
exponentiation operator, 230, 400, 401
export command, 110, 169, 474
expr command, 159-161
Extended Binary Coded Decimal Interchange Code (EBCDIC), 439, 489
extended pattern matching, 393
Extended Regular Expressions (EREs), 30, 42-45, 490
      metacharacters for, 34
      operator precedence for, 45
      programs using, 46-48
      (see also egrep command)
extended test facility, 392-393
eXtensible Markup Language (XML), 490
extensions, xv
external commands, 14
extglob option, 393
ex/vi program, regular expressions used by, 47

F[ Top ]
\f escape sequence, 16, 148
.f file extension, 470
%f format specifier, 149, 150, 261
-f shell option, 174
-f test expression, 125, 392
.f90 file extension, 470
false command, 169, 474
fc command, 169, 172
fflush() function, awk, 251
fg command, 169, 172
fgrep command, 31, 475
.fi command, troff, 430
field separators, awk, 63, 237
fields, 57, 490
      awk language, 62, 225
      joining, 60
      rearranging, 62-65
      selecting, 58
      separating in text files, 57
      separator characters for, 117
      sorting based on, 70-72
FIFO (first in first out), 490
file checksums, 301
      (see also digital signature)
file command, 85, 475
file descriptors, 145-147, 490
file extensions, conventions for, 469-470
file generation numbers, 470
file sizes, total used (see filesystem space)
File Transfer Protocol (FTP), 490
file type, 286, 490
filename, 491
      containing special characters, finding, 292
      extracting directory path from, 201
      restrictions on, 438-441
      suffix of, 505
      wildcards in, 153-155
filename collisions, 438
FILENAME variable, awk, 232
FILENAME_MAX constant, 444
files, 437
      access time for, 286, 460-461
      appending standard output to, 19
      binary files, 442
      commands for, list of, 475
      comparing contents of, 299
      comparing file checksums, 301
      devices as, 450
      differences between, finding, 300
      differences between, reconstructing file from, 300
      digital signature verification for, 303-307
      empty files, 125, 273, 442
      file type of, 271, 466
      finding, 279, 280-291
      finding in a search path, 177-192
      format of contents, 441-443
      group of, listing, 272
      hidden files, 155, 270, 282
      holes in, 465
      inode-change time for, 286, 460-461
      line-terminator conventions for, 442
      links for, 449, 461-463
      listing, 267-272
      metadata for, listing, 272
      modification time for, 272, 273-274, 286, 460-461
      monitoring access of, 370
      not overwriting with I/O redirection, 143
      number of, in directory, 443
      opening for both reading and writing, 144
      ownership of, 272, 452, 467-469, 496
      pathname for, 443
      permissions for, 271, 453-458, 467-469
      printing, 78-83
      reading, 141
      searching for text in, 241
      size limits of, 450-452
      size of, 272, 463
      temporary, 274-278
      test expressions for, 125
      text files, 441
            records and fields in, 57
            structured, extracting data from, 87-94
      timestamps for, 460-461, 465
filesystem space
      df command for, 295-297
      du command for, 297-299
      find command for, 295
      ls command for, 295
filesystems
      hierarchical, 443-450
      implementation of, 447-450
      layered, 445-447
      mounting, 445
filters, 140, 491
find command, 280-291, 464, 475
      -a (AND) option, 287
      actions to be taken on found files, 282
      -atime option, 286
      -ctime option, 286
      -exec option, 282
      -follow option, 286
      -fprint option, 290
      -group option, 285
      hidden files found by, 282
      -links option, 286
      -ls option, 283
      -mtime option, 286
      -name option, 289
      -newer option, 286
      -o (OR) option, 287
      -perm option for, 285
      -print option, 282
      -print0 option, 292
      -prune option, 282
      -size option, 285
      sorting results of, 282, 283
      -true option, 289
      -type option, 286
      -user option, 285
flags for printf command, 151
floating-point arithmetic, awk, 229
fmt command, 76, 475
FNR variable, awk, 232
folders (see directories)
fonts
      changing, in HTML, 96
      in troff, 425, 427
      used in this book, xix
fonts, in troff, 428
for statement, 130
      arithmetic, 399
      awk, 245-247
foreground processes, 357, 491
fork() function, 352
format specifiers, 18, 149, 491
formfeed, escape sequence for, 16, 148
forward slash (/)
      forbidden in filenames, 439
      in pathname, 445
      root directory, 443
fpathconf() function, 444
frequency of words, creating list of, 102-104
FS variable, 62, 224, 232, 237
fstat() function, 447
FTP (File Transfer Protocol), 490
function statement, awk, 252-255
functions, 14, 135-138, 491
      arguments for, 136
      disabling command history for, 174
      finding location of, 280
      line number just ran, 118
      positional parameters in, 136
      removing from environment, 111
      user-defined, awk, 252-255
fuser command, 476

G[ Top ]
%G format specifier, 149, 150
%g format specifier, 149, 150, 261
-G test expression, 392
-g test expression, 125, 392
gawk interpreter, 223, 224
      (see also awk interpreter)
-ge test expression, 125, 393
Generic Network Queueing System, 375
getconf command, 444
get_dictionaries() function, awk spellchecker, 334
getgrent() function, 453
getline statement, awk, 249-250
getopts command, 133, 169, 474
getpubkey command, 306
getpwent() function, 453
gettext package, 28
global variables, case of, 180
globbing (see pathname expansion)
GMT (Greenwich Mean Time), 460
GNU General Public License (GPL), xxi
GNU Info system (see info command)
GNU Privacy Guard (GnuPG), 303
GnuPG (GNU Privacy Guard), 303
gpg command, 306
GPL (GNU General Public License), xxi
gradual underflow, 491
Greenwich Mean Time (GMT), 460
grep command, 5, 23, 30, 32, 475
      constant strings, searching for, 31
      -F option, 31
      regular expressions for, 33-36
      regular expressions used by, 47
      solving word puzzles using, 100-101
groff command, 435
gr_osview command, 356
group, 285, 491
group files, 322, 453
group ownership, 453
grouping, in Extended Regular Expressions, 44, 45
gsub() function, 73, 257
-gt test expression, 125, 393
gunzip command, 475
.gz file extension, 470
gzip command, 475

H[ Top ]
.h file extension, 470
-h shell option, 174
-h test expression, 125, 392
hacker, 492
hard links, 286, 449, 461-463, 492
hash mark (#)
      ## (pattern-matching operator), 114
      #! (specifying interpreter in shell script), 10-12
      pattern-matching operator, 114
      preceding comments, 24
      preceding comments, awk, 226
      prefixing temporary backup file name, 470
      printf flag, 151
      string-length operator, 115
      variable, 117
head command, 83, 157, 476
HEAD object, HTML, 96
--help option, 182
here documents, 98, 143, 144, 492
here strings, 400
Hewlett-Packard PCL (Printer Command Language), 80
hexadecimal, 492
hidden files, 155
      finding, 282
      listing, 270
hierarchical filesystem, 443-450
history of Unix, 1-4
holding space, 35, 492
holes in files, 465
home (login) directory, 117, 152
HOME variable, 117
horizontal tab, escape sequence for, 16, 148
hot spots, 492
HPGL (HP Graphics Language), 80
.htm file extension, 470
.html file extension, 470
HTML (HyperText Markup Language), 492
      converting troff markup to, 436
      formatting text as, 94-100
      syntax for, 95-97
      tag lists, creating, 105-107
HTTP (HyperText Transport Protocol), 492
HUP signal, 361, 362
HyperText Markup Language (see HTML)
HyperText Transport Protocol (see HTTP)
hyphen (-)
      -- (arithmetic operator), 118, 230, 400, 401
      -= (assignment operator), 119, 230, 401
      -- (end of options), 13
      arithmetic operator, 118, 230, 401
      as bare option, 12
      expr operator, 160
      in filenames, 440
      preceding command options, 13
      preceding file type in listing, 466
      printf flag, 151
      variable, 117

I[ Top ]
%i format specifier, 149, 150, 261
i18n (see internationalization)
.IB command, troff, 428
IBM LoadLeveler, 375
icons used in this book, xx
iconv command, 475
id command, 474
IEEE 754 Standard for Binary Floating-Point Arithmetic, 229
IEEE Std. 1003.1 - 2001 standard, xv, 3
if statement
      awk, 244
      exit status and, 121-122
IFS variable, 117, 141, 178
IGNORECASE variable, awk, 256
ignoreeof shell option, 174
implementation-defined, 17, 493
in Basic Regular Expressions, 35
increment operator, 118, 230, 400, 401
index() function, awk, 256
index node (inode), 447
indexed arrays, 396-399
Infinity, in floating-point arithmetic, 229
info command, 477
InfoZip format, 204
initialize() function, awk spellchecker, 333
inline input, 143
inode (index node), 447, 493
inode-change time for files, 286, 460-461
input redirection (see I/O redirection)
insertion sort algorithm, 74
int() function, awk, 231, 264
integers, numeric tests for, 125, 128
International Organization for Standardization (see ISO)
internationalization, 25-28
      regular expressions features for, 33, 35-36, 38
      sorting conventions and, 69
Internet Protocol (IP), 493
interpreted languages, 9
interpreter, 9, 10-12
interval expressions, 34, 40, 43, 493
I/O redirection, 19-22, 143-147, 493
      awk, 250
      exec command for, 146
      file descriptors for, 145-147
      preventing overwriting of existing files, 174
iostat command, 356
.IP command, troff, 429
IP (Internet Protocol), 493
.IR command, troff, 428
ISO (International Organization for Standardization), 493
      code pages, 439
      superseding ANSI, 484
ispell command, 329-330, 347
iterative execution (see looping)

J[ Top ]
job control, 174, 493
jobs command, 169, 172
join command, 60, 89, 91, 475
join() function, awk, 260

K[ Top ]
-k test expression, 392
kernel context, 353
kill command, 169, 172, 360-363, 476
KILL signal, 361, 362
Korn, David, UWIN package, xxii
Korn shell (see ksh)
ksh (Korn shell), 408, 473
ksh88 shell
      extended pattern matching in, 393
      startup, 408
ksh93 shell
      differences from bash, 381-385
      downloading, 404
      privileged mode, 421
      startup, 408
ktrace command, 368

L[ Top ]
l, preceding link in listing, 466
-L test expression, 125, 392
-l test expression, 392
l10n (see localization)
LANG variable, 26, 117
language
      for output messages, 118
      (see also internationalization; localization)
layered filesystems, 445-447
LC_ALL variable, 26, 117
LC_COLLATE variable, 26, 117
LC_CTYPE variable, 26, 118
LC_MESSAGES variable, 26, 118
LC_MONETARY variable, 26
LC_NUMERIC variable, 26
LC_TIME variable, 26
-le test expression, 125, 393
left angle bracket (<)
      <!-- ... --> (HTML comments), 96
      <<= (assignment operator), 119, 401
      <= (comparison operator), 118, 230, 401
      <= (expr operator), 160
      << (arithmetic operator), 118, 401
      << (here document), 98, 143
      <<- (here document, leading tabs removed), 144
      <<< (here strings), 400
      <> (open file for reading and writing), 144
      changing standard input, 19
      comparison operator, 118, 230, 401
      expr operator, 160
      test expression, 393
left-associative, 494
length() function, awk, 227
less command, 475
let command, 399
lettercase conversion, awk, 256
lex program, regular expressions used by, 47
line continuation character, 142, 226, 494
line number of script or function, 118
LINENO variable, 118
lines
      changing line breaks, 76
      counting, 10, 77
      extracting first and last lines from text, 83-86
line-terminator conventions in files, 442
LINK object, HTML, 96
links, 449, 461-463, 494
      count of, in file listing, 272
      hard links, 286, 492
      preceded by l in listing, 466
      symbolic links, 125, 286, 415, 505
load average, 352, 494
load_dictionaries() function, awk spellchecker, 336
load_suffixes() function, awk spellchecker, 337
local variables, case of, 180
locale, 494
      environment variables for, 26-28
      name of, 117
locale command, 26, 477
localization, 25-28
      regular expressions features for, 33, 35-36, 38
      sorting conventions and, 69
locate command, 279, 476
lock for running program, 494
log() function, awk, 264
logger command, 414, 477
logical AND operator, 118, 122, 401
logical NOT operator, 118, 122, 401
logical OR operator, 118, 122, 401
login directory (see home directory)
login shell, 406
looping, 130-135
      arithmetic for loop, 399
      awk language, 245-247
      portability of, 383
      select statement, 389-392
lp command, 79, 477
LPDEST variable, 79
lpq command, 79, 477
lpr command, 79, 477
lprm command, 79
LPRng (lpr next generation), 80
lpstat command, 79
ls command, 268-272, 463, 476
-lt test expression, 125, 393

M[ Top ]
-m shell option, 174
magnetic disks, 437
mail command, 199, 477
mailing list, implementing with command substitution, 157-159
mailx command, 199
make command, 212, 477
Makefile file, 192
makeinfo program, 423
makewhatis program, 436
man command, 477
MANPATH environment variable, 436
manual pages
      converting to other output formats, 436
      creating, 424-431
      formats for, 423
      installing, 436
      output forms of, 423
      syntax checking for, 435
markup removal, 349
match, 494
match() function, awk, 257
Maui Cluster Scheduler, 375
mawk interpreter, 223, 224
      (see also awk interpreter)
McIlroy, Doug, word list solution by, 102
md5 command, 301
md5sum command, 301, 476
message catalogs, location of, 118
messages
      language for, 118
      printing right away, 174
      Software Tools principles for, 5
metacharacters, 494
      avoiding in filenames, 440
      escaping, 37, 45
      in regular expressions, 34, 40
metadata, 447, 494
minus sign (see hyphen)
mkdir command, 476
MKS Toolkit, xxii
mktemp command, 118, 276, 476
modification time for files, 272, 273-274, 286, 460-461
modifier, 495
modifier metacharacters, in regular expressions, 40
monitor command, 356
monitor shell option, 174
more command, 47, 475
Mortice Kern Systems, MKS Toolkit, xxii
mount command, 445
mounting, 495
mpstat command, 356
Multics operating system, 1
multiplication operator, 118, 401

N[ Top ]
\n escape sequence, 16, 148
-n shell option, 174
-N test expression, 392
-n test expression, 125, 392
named pipe, 125, 466, 495
NaN (not-a-number), in floating-point arithmetic, 229
nawk interpreter, 223
      (see also awk interpreter)
-ne test expression, 125, 393
netstat command, 356
Network File System (NFS), 447, 495
networks
      accessing with secure shell software, 468
      security and, 468
newgrp command, 169
newline
      escape sequence for, 16, 148
      suppressing, escape sequence for, 16, 148
next statement, awk, 248
nextfile statement, awk, 248
.nf command, troff, 430
NF variable, 62, 232
NFS (Network File System), 447, 495
nfsstat command, 356
nice command, 352, 476
NLSPATH variable, 118
noclobber shell option, 143, 174
noexec shell option, 174
noglob shell option, 174
nolog shell option, 174
not equal operator, 118, 230, 401
not-a-number (NaN), in floating-point arithmetic, 229
notify shell option, 174
nounset shell option, 174
NR variable, awk, 232
nroff command, 435
nroff markup format, 423, 424
-nt test expression, 393
NUL character, 439
      in Basic Regular Expressions, 39
      matching, 46
null string, 495
null values, 14
numbers, in awk, 228-232
numeric functions, awk, 264-266

O[ Top ]
.o file extension, 470
%o format specifier, 149, 150, 261
-o logical OR, test expression, 126
-O test expression, 392
-o test expression, 392
oawk interpreter, 223
      (see also awk interpreter)
object code, 8
octal, 495
octal value, escape sequence for, 17, 148
od command, 85, 269, 476
OFS variable, awk, 232
OLDPWD variable, 399
opendir() function, 448
operator precedence
      in Basic Regular Expressions, 42
      in Extended Regular Expressions, 45
OPTARG variable, 133
optical storage devices, 438
OPTIND variable, 133, 135, 382
options, command line, 13, 133, 495
order_suffixes() function, awk spellchecker, 339
ordinary character, 495
O'Reilly Media, Inc., contact information, xxiii
ORS variable, awk, 232, 239
osview command, 356
-ot test expression, 393
other ownership, 453, 495
output redirection (see I/O redirection)
output, Software Tools principles for, 5
overflow, 495
ownership, 496
      finding files based on, 285
      of files, 272, 452, 467-469
      of groups, 453
      of other users, 453, 495
      of processes, 355

P[ Top ]
p, preceding named pipe in listing, 466
-p test expression, 125, 392
par command, 368
parameter expansion, 113-118, 496
      length of variable's value, 115
      pattern-matching operators for, 114
      substitution operators for, 113
parent process ID (PPID), 118, 355
parentheses ((...))
      ((...)) (arithmetic command), 399
      grouping arithmetic expressions, 119
      grouping, expr expressions, 160
      in Extended Regular Expressions, 44
      in regular expressions, 35
      subshell, 167
partition, 496
pass by reference, 486
pass by value, 486
passwd file, 453
      extracting data from, 88-94
      history of, 309
      merging two password files, 309-320
      problems with, 308
      structure of, 87
password file (see passwd file)
patch, 496
patch command, 300, 476
path searching, 177-192
PATH variable, 118
      adding current directory to, 23
      adding directories to, 22
      commands searched with, 22
      current directory in, avoiding, 413
      default value for, 22
      finding commands in, 280
      protecting directories in, 414
      resetting in script, for security, 179
pathconf() function, 444
PATH_MAX constant, 443
pathname, 443, 496
      basename component of, 485
      extracting directory path from, 201
      extracting filename from, 181
pathname expansion, 496
pattern matching (see regular expressions)
pattern space, 52, 496
pattern-matching operators, 114
patterns, awk, 225, 238
PCL (Printer Command Language), 80
.pdf file extension, 470
PDF (Portable Document Format), 80, 82
pdksh (Public Domain Korn Shell), 405, 473
percent sign (%)
      %= (assignment operator), 119, 230, 401
      %% (format specifier), 149
      %% (format specifier, awk), 261
      %% (pattern-matching operator), 115
      arithmetic operator, 118, 230, 401
      expr operator, 160
      pattern-matching operator, 114
      preceding format specifications, 18
      preceding printf format specifiers, 149
perfmeter command, 356
permissions, 497
      changing, 454
      default, 455
      displaying, 454
      finding files based on, 285
      for directories, 458-460
      for files, 271, 453-458, 467-469
pgp command, 306
PGP (Pretty Good Privacy), 303
pgpgpg command, 306
pgrep command, 363
PID (process ID), 355
pipelines, 10, 497
      creating, 19
      extracting data from text using, 87-94
      formatting text as HTML using, 94-100
      named pipe, 125, 466, 495
      performance of, 21
      solving word puzzles using, 100-101
      tag lists using, 105-107
      word frequency lists using, 102-104
pkill command, 363
Platform LSF system, 375
plus sign (+)
      ++ (arithmetic operator), 118, 230, 400, 401
      += (assignment operator), 119, 230, 401
      arithmetic operator, 118, 230, 401
      expr operator, 160
      in Extended Regular Expressions, 43
      in regular expressions, 35
      in trace output, 24
      printf flag, 151
portability
      of #! line in shell script, 11
      of shell scripts, xiii, 9
      shell, 381-385
Portable Batch System, 375
Portable Document Format (see PDF)
positional parameters, 23, 109, 115-117, 497
      changing, 174
      in functions, 136
      removing one at a time, from the left, 116
      setting explicitly, 116
POSIX standards, xv, 3
postfix operator, 119
PostScript, Adobe, 80, 82
pound sign (see hash mark)
.PP command, troff, 428
PPID (parent process ID), 355
PPID variable, 118
pr command, 80-82, 475
prefix operator, 119
Pretty Good Privacy (PGP), 303
print daemon, 78
print queue
      name of, 79
      removing files from, 79
      sending files to, 79
      status of, reporting, 79
print spooler, 497
print statement, awk, 64, 239, 250
Printer Command Language (see PCL)
printer, default, setting, 79
PRINTER variable, 79
printf command, 17, 147-152, 475
      escape sequences for, 148
      flags for, 151
      format specifiers for, 149
      precision modifier, 150
      width modifier, 150
printf() function, awk, 261-264
printf statement, awk, 64, 250
printing, 78-83
privileged mode, 497
/proc filesystem, 378-379
process ID (PID), 117, 355
      of last background command, 117
      of parent process, 118
process substitution, 395-396
processes, 352
      accounting of, 372
      background process, 485
      commands for, list of, 476
      controlling terminal for, 353, 487
      current, arguments for, 117
      delayed scheduling of, 373-377
      deleting, 361-363
      ending, 352, 360
      foreground process, 491
      interrupting foreground processes, 357
      kernel context for, 353
      listing, 354-360
      owner of, 355
      PID (process ID), 355
      PPID (parent process ID), 355
      priority of, 352
      running commands in a separate process, 167
      running in background, 356
      scheduler managing, 352
      starting, 352, 353
      system-call tracing for, 368-371
      terminating prematurely, 360
      trapping signals, 363-367
      virtual address space for, 353
procinfo command, 356
proctool command, 356
.profile file, adding to PATH in, 22
Programmer's Workbench Unix (PWB), 497
prompt string, 118
protocol, 497
prstat command, 356
ps command, 354-360, 476
.ps file extension, 470
PS1 variable, 118
PS2 variable, 118
PS4 variable, 118
pseudodevices, 497
      random, 277, 450
pstat command, 356
ptree command, 356
Public Domain Korn Shell (see pdksh)
public-key cryptography, 303, 498
public-key servers, 304, 498
punctuation characters, avoiding in filenames, 440
PWB (Programmer's Workbench Unix), 497
pwd command, 169, 476
PWD variable, 118, 399

Q[ Top ]
question mark (?)
      ?: (conditional expression), 119, 230, 401
      in Extended Regular Expressions, 43
      in regular expressions, 35
      variable, 117, 120
      wildcard, 153
quoting, 161, 498
      of shell variables containing filenames, 441
      results of wildcard expansion, 415
      user input, 414

R[ Top ]
\r escape sequence, 16, 148
-r test expression, 125, 392
race condition, 415
RAM (random-access memory), 498
      filesystems residing in, 437
Ramey, Chet (bash maintainer), prolog for making shell scripts secure, 416
rand() function, awk, 264
random pseudodevices, 277, 450
random-access memory (see RAM)
range expressions, 239, 499
ranges, 37, 499
.RB command, troff, 428
rbash (restricted bash), 417
rcp command, 196
rcs command, 477
rcs (Revision Control System), 470, 477, 500
rcsdiff command, 477
.RE command, troff, 430
read command, 140-143, 169, 474
read permission, 453, 458, 499
readable file, test expression for, 125
readdir() function, 448
readonly command, 110, 169, 474
records, 56, 499
      as lines in text files, 57
      awk language, 62, 225, 236
      changing line breaks, 76
      duplicate, removing, 75
      multiline, sorting, 72
      sorting, 67-72
      unique key for, 94
recursion, 254, 499
redirection (see I/O redirection)
regular built-in commands, 168
regular expressions, 33-36
      awk support for, 228, 238
      Basic Regular Expressions, 30, 37-42, 485
      character classes in, 36
      collating symbols in, 36
      commands using, 33
      equivalence classes in, 36
      extended pattern matching in ksh for, 393
      Extended Regular Expressions, 30, 42-45, 490
      extensions to, 45
      in sed program, 53
      internationalization and localization features for, 33, 35-36, 38
      locale for pattern matching, 118
      metacharacters in, 34
      programs using, 46-48
      Software Tools principles for, 5
      solving word puzzles using, 100-101
relational databases, 95
remainder operator, 118, 401
remote shell, 196, 499
remove, 499
renice command, 352, 476
report_exceptions() functions, awk spellchecker, 342
Request for Comments (RFC), 500
restricted shell, 416-418, 500
return command, 136, 169, 474
return statement, awk, 253
Revision Control System (rcs), 470, 477, 500
RFC (Request for Comments), 500
.RI command, troff, 428
right angle bracket (>)
      >> (appending to standard output), 19
      >> (arithmetic operator), 118, 401
      >> (output redirection, awk), 251
      >>= (assignment operator), 119, 401
      >= (comparison operator), 118, 230, 401
      >= (expr operator), 160
      >| (redirect output overriding noclobber), 143, 145
      changing standard output, 19
      comparison operator, 118, 230, 401
      expr operator, 160
      output redirection, awk, 251
      test expression, 393
right-associative, 500
rksh (restricted ksh93), 416
RLENGTH variable, awk, 257
rlog command, 477
rm command, 476
rmdir command, 476
root directory, 443, 501
root user
      package installations by, 211
      security and, 415
.RS command, troff, 430
RS variable, awk, 232, 236
rsh command, 196
RSTART variable, awk, 257
RT variable, awk, 237
runoff markup format, 424

S[ Top ]
.s file extension, 470
%s format specifier, 149, 150, 261
s, preceding socket in listing, 466
-S test expression, 125, 392
-s test expression, 125, 392
sappnd permission, 501
sar command, 356
scalar variables, 232, 501
scan_options() function, awk spellchecker, 335
sccs (Source Code Control System), 470, 503
scheduler, 352, 501
scp command, 196, 477
scratch file, 501
scripts (see shell scripts)
sdtperfmeter command, 356
search path
      for commands, 118
      script implementing, 177-192
      special vs. regular built-in commands affecting, 169
      (see also PATH variable)
searching for text (see grep command)
secure shell, 196, 468, 501
security
      bare option in #! line, 12
      current directory in PATH, 23
      data encryption, 468
      digital signature verification, 303-307
      file ownership and permissions, 467-469
      guidelines for secure shell scripts, 413-416
      IFS variable and, 178
      monitoring of files by system managers, 467
      of locate command, 279
      of networked computers, 468
      of temporary files, 275, 276
      package installations by root user, 211
      PATH variable and, 179
      restricted shell, 416-418
      secure shell access to network, 468
      setuid and setgid bits, 415, 419
      Trojan horses, 418
sed command, 48-56, 475
      command substitution and, 157
      extracting first lines, 83
      regular expressions used by, 47
      tag list example using, 106
      word frequency example using, 102
select statement, 389-392
semicolon (;)
      ending HTML entities, 96
      separating commands, 13
      separating statements, awk, 240, 244
set command, 116, 169, 172-175, 474
      -C option, 143
      noclobber option, 143
      portability of, 383-385
      shopt command as alternative to, 385-389
      -x option, 25
setgid bit
      security and, 415, 419
      test expression for, 125
setgrent() function, 453
set-group-ID bit, 457, 459, 501
setpwent() function, 453
setuid bit
      privileged mode and, 421
      security and, 415, 419
      test expression for, 125
set-user-ID bit, 457, 502
SGML (Standard Generalized Markup Language), 94, 424, 504
sh (Bourne shell), 407, 473
.SH command, troff, 426
.sh file extension, 470
shadowed, 502
Shakespeare, word frequency lists of, 103
sharp sign (see hash mark)
shell, 502
      bash (Bourne Again Shell), 381-389, 402-403, 408-410, 473
      evaluation of commands, 162-166
      exiting, disabling Ctrl-D for, 174
      exiting on error, 174
      interactive, file to be executed at startup, 117
      ksh (Korn shell), 408, 473
      login shell, 406
      name of, 117
      pdksh (Public Domain Korn Shell), 405, 473
      process ID for, 117
      replacing with specific program, 146
      restricted, 416-418, 500
      secure, 196, 468, 501
      sh (Bourne shell), 407, 473
      startup and termination of, 406-412
      subshells, 167, 505
      version number of, finding, 405
      zsh (Z-Shell), 405, 410-412, 473
shell functions (see functions)
shell options, 502
      list of, 174
      setting, 172-175
      variable containing enabled options, 117, 175
shell portability, 381-385
shell scripts, xiii
      creating, 9
      evaluation order of, 162-166
      interpreter for, specifying, 10-12
      knowledge requirements for, xvi
      line number just ran, 118
      portability of, xiii, 9, 11
      reasons to use, 9
      security guidelines for, 413-416
      Software Tools principles for, xiii, 4-6
      tracing, 24, 118
      uses of, 8
shell state, saving, 381
shell variables (see variables)
shift command, 116, 132, 169, 474
      path search example using, 183
      software build example using, 197, 199
shopt command, 385-389
short-circuit operators, 123
show command, 155
side effect, 502
signal() function, 363
signal handler, 364, 503
signals, 503
      for deleting processes, 361-363
      sending to processes, 360
      trapping, 363-367
Silver Grid Scheduler, 375
sin() function, awk, 264
single quotes ('...'), literal interpretation, 161
Single UNIX Specification, xv, 4, 503
slash (/)
      /= (assignment operator), 119, 230, 401
      arithmetic operator, 118, 230, 401
      expr operator, 160
      forbidden in filenames, 439
      in pathname, 445
      root directory, 443
sleep command, 373, 476
.so file extension, 470
sockets
      preceded by s in listing, 466
      test expression for, 125
soft links, 449, 461-463
software builds, automating, 192-222
Software Tools philosophy, xiii, 4-6
software-packaging conventions, 192
sort command, 67-75, 475
      duplicate records, removing, 75
      efficiency of, 74
      field to sort on, 70-72
      -k option, 70-72
      stability of, 74
      -t option, 70-72
      tag list example using, 106
      -u option, 75
      with multiline records, 72
      word frequency example using, 102
sorting algorithms, 74, 504
sorting, locale to use for, 117
source code, 8, 192-222
Source Code Control System (sccs), 470, 503
space used by filesystem (see filesystem space)
spaces (see whitespace)
sparse, 503
special built-in commands, 168
special characters, xix, 503
      in filenames, 292, 439, 441
      (see also metacharacters)
spell command, 325, 327, 347, 475
spellchecking
      aspell command, 329-330
      history of, 347
      implementing in awk, 331-343, 348
      ispell command, 329-330
      original prototype for, 326
      private spelling dictionaries for, 328
      spell command for, 325
spell_check_line() function, awk spellchecker, 340
spell_check_word() function, awk spellchecker, 340
spelling dictionary, 100, 328, 503
spelling exception list, 503
split() function, awk, 258-260
spoofing attacks, preventing, 12
spooled, 503
sprintf() function, awk, 261-264
SQL (Structured Query Language), 95, 504
sqrt() function, awk, 264
square brackets ([...])
      [: ... :] (character classes), 36, 38
      [. ... .] (collating symbols), 36, 38
      [= ... =] (equivalence classes), 36, 38
      [ ... ] (test command variant form), 124
      [[...]] (extended test facility), 392-393
      array indices, awk, 233
      in regular expressions, 34, 486
      wildcard set, 153
srand() function, awk, 264
.SS command, troff, 431
ssh command, 196, 477
SSHFLAGS variable, 196
stability, 504
standard error, 18, 140, 504
      file descriptor for, 145
      filename of, 451
Standard Generalized Markup Language (see SGML)
standard input, 18, 140, 504
      changing to file, 19
      evaluation order of, 162-166
      file descriptor for, 145
      filename of, 451
      printing from, 79
      receiving from previous program in pipeline, 19
      receiving from terminal, 21
standard I/O, 5, 18, 140, 504
      (see also standard error; standard input; standard output)
standard output, 18, 140, 504
      appending to file, 19
      changing to file, 19
      discarding to /dev/null, 21
      file descriptor for, 145
      filename of, 451
      redirecting to next program in pipeline, 19
      writing to terminal, 21
standards
      IEEE Std. 1003.1 - 2001, xv, 3
      POSIX standards, xv, 3
      unspecified behaviors in, xv
      X/Open, 3
stat command, 273, 466
stat() function, 447
sticky bit, 457, 459, 504
STOP signal, 361, 362
strace command, 368
Stream Editor (see sed command)
string constants, awk, 226
string functions, awk, 255-264
string substitution, awk, 257
string-length operator, 115
strings
      comparing, awk, 227
      concatenating, awk, 227
      converting to numbers, awk, 228
      extended notation for, 401
      formatting, awk, 261-264
      matching, awk, 257
      reconstruction, awk, 260
      searching, in awk, 256
      splitting, awk, 258-260
      test expressions, 127
      test expressions for, 125
strings command, 85, 476
strip_suffixes() function, awk spellchecker, 341
Structured Query Language (SQL), 95, 504
stty command, 357, 474
su command, 418
sub() function, awk, 257
SUBSEP variable, awk, 234
subshells, 167, 505
substitution operators, 113
substitution (see expansion)
substr() function, awk, 256
substring extraction, awk, 256
subtraction operator, 118, 401
sudo program, 421
suffix, 505
suid_profile file, 421
sum command, 301
Sun GridEngine, 375
superuser, 505
symbolic links, 449, 461-463, 505
      following to find broken links, 286
      security and, 415
      test expression for, 125
symlink, 449
syslog command, 414
systat command, 356
system call tracers, 368-371
system() function, awk, 251
system managers, monitoring file contents, 467

T[ Top ]
\t escape sequence, 16, 148
-t test expression, 125, 392
TABLE environment, HTML, 97
tabs, escape sequence for, 16, 148
tag lists
      creating, 105-107
      processing, 137
tags, HTML, 96
tail command, 84, 476
tar command, 476
.tar file extension, 470
TCP (Transmission Control Protocol), 506
tee command, 475
temporary files, 274-278
TERM signal, 361, 362
terminal
      redirecting to, 21
      test expression for, 125
test command, 124-128, 474
test facility, extended, 392-393
TEX, 82
Texinfo markup format, 423, 436
text
      characters
            counting, 10, 77
            transliterating, 20
      commands for, list of, 474
      counting lines, words, characters in, 77
      duplicate records in, removing, 75
      extracting first and last lines of, 83-86
      formatting as HTML, 94-100
      processing of, history of, 3
text (continued)
      reformatting paragraphs in, 76
      searching for (see grep command)
      Software Tools principles for, 4
      sorting multiline records in, 72
      sorting records in, 67-72
      words, 507
            counting, 10, 77, 240
            frequency list of, 102-104
            separator characters for, 117
            tags in, finding, 105-107
      (see also strings)
text files, 441
      (see also files)
text substitution, 48-56
tgrind command, 83
.TH command, troff, 425
.ti command, troff, 427
tilde (~)
      ~- ($OLDPWD tilde expansion), 399
      ~+ ($PWD tilde expansion), 399
      arithmetic operator, 118, 401
      in temporary backup file name, 470
      matches operator, awk, 228
      tilde expansion, 152, 399, 505
tilde expansion, 152, 399, 505
time
      epoch for, 274
      representation of, 274
time slice, 352, 505
times command, 169, 172
timestamps for files, 286, 460-461, 465
TITLE object, HTML, 96
/tmp directory, 206, 275
TMPDIR variable, 276
tolower() function, awk, 256
toolbox approach (see Software Tools philosophy)
tools, xiii, xiv
top command, 355, 357, 476
touch command, 273-274, 461, 476
toupper() function, awk, 256
.TP command, troff, 428
tr command, 20, 475
      tag list example using, 105-107
      word frequency example using, 102
trace command, 368
tracing (see execution tracing)
Transmission Control Protocol (TCP), 506
trap, 506
trap command, 90, 169, 276, 364-367, 474
      -p option, 400
tree structure of filesystem, 443, 506
troff command, 82, 435
troff markup format, 423
      command syntax, 425
      comments in, 425
      creating manual pages using, 424-431
      fonts in, 425, 427, 428
      white space in, 425
Trojan horses, 418, 506
true command, 169, 474
truss command, 368
TSTP signal, 361
type command, 280, 474
typeset command, 474
typo command, 347

U[ Top ]
%u format specifier, 149, 150, 261
-u shell option, 174
-u test expression, 125, 393
uappnd permission, 506
ulimit command, 452, 474
umask command, 169, 172, 455, 467, 476
umount command, 445
unalias command, 169, 171
unary minus operator, 118, 401
unary plus operator, 118, 401
unexpand command, 475
Unicode character set, 25, 35, 99, 333, 348, 439, 471, 506
uniform resource locator (URL), 445, 507
uniq command, 75, 475
      tag list example using, 106
      word frequency example using, 102
unique key, 94
Unix, history of, 1-4
Unix spelling dictionary, 100
Unix User's Manual, references to, xx
unlink() function, 275
unset command, 111-113, 169, 474
until statement, 130
unzip command, 476
updatedb command, 279
uptime command, 352, 356, 477
urandom device, 450
URL (uniform resource locator), 445, 507
user, 507
user input
      checking for metacharacters, 415
      quoting, 414
      running eval command on, 415
user ownership, 453
user-controlled input, awk, 249-250
user-defined functions, awk, 252-255
userhosts file for customization, 193
usr directory, 444
/usr/tmp directory, 275
UTC (Coordinated Universal Time), 460, 488
UTF-8 encoding, 78, 333, 348, 439, 471, 507
utime() function, 461
UWIN package, xxii

V[ Top ]
\v escape sequence, 16, 148
,v file extension, 470
-v shell option, 174
variables, 14
      array variables, 233-234, 485
      assigning values to, 15
      built-in, in awk, 232
      changing for program environment, 111
      exporting all subsequently defined, 174
      global, case of, 180
      in format specifiers, 151
      in functions, awk, 253
      length of value of, 115
      local, case of, 180
      naming conventions for, 180
      passed in to scripts, security of, 414
      printing all values of, 174
      putting in program environment, 111
      putting into environment, 110
      reading data into, 140-143
      read-only, setting, 110
      removing from environment, 111-113
      removing from program environment, 111
      retrieving values from, 15, 113-118
      scalar, in awk, 232
      undefined, treating as errors, 174
/var/tmp directory, 275
verbose shell option, 174
--version option, 182
vertical bar (|)
      |= (assignment operator), 119, 401
      || (logical OR operator), 118, 123, 230, 401
      alternation operator, 43, 484
      bitwise OR operator, 118, 401
      expr operator, 160
      in regular expressions, 35
      pipe symbol, 10
vertical tab, escape sequence for, 16, 148
vgrind command, 83
vi shell option, 174
vi, using for command-line editing, 174
virtual machine, 507
vmstat command, 356
vmubc command, 356

W[ Top ]
w command, 356
-w test expression, 125, 393
wait command, 169, 172, 356, 476
wc command, 10, 77, 240, 475
websites
      awk interpreter, free implementations of, 224
      batch queue and scheduler systems, 375
      code examples, xxi
      cygwin environment, xxi
      DJGPP suite, xxii
      MKS Toolkit, xxii
      O'Reilly Media, Inc., xxiii
      public-key servers, 304
      Single UNIX Specification, xv
      sudo program, 421
      Unix history, 1
      Unix-related standards, xv
      UWIN package, xxiii
wget command, 306
while statement, 130
      awk, 245-247
      path search example using, 181
      read file example using, 141
      software build example using, 197
whitespace, 507
      awk language, 226
      in command line, 13
      in filenames, 441
      in HTML, 96
who command, 9, 474
wildcard expansion
      disabling, 174
      of command-line arguments, 353
      quoting results of, 415
      (see also pathname expansion)
wildcards
      in filenames, 153-155
      in parameter expansion, 114
Windows operating system, Unix tools for, xxi-xxiii
wireless networks, security and, 468
word matching, in regular expressions, 46
word puzzles, pattern matching dictionary for, 100-101
word-constituent characters, 46, 507
words, 507
      counting, 10, 77, 240
      frequency list of, 102-104
      separator characters for, 117
      tags in, finding, 105-107
working directory (see current working directory)
writable file, test expression for, 125
write permission, 453, 458, 507

X[ Top ]
%X format specifier, 149, 150, 261
%x format specifier, 149, 150, 261
-x shell option, 174
-x test expression, 125, 393
xargs command, 293, 476
xcpustate command, 356
xload command, 356
XML (eXtensible Markup Language), 490
      converting troff markup to, 436
      defining multiline records with, 74
      for manual pages, 424
X/Open Portability Guide, Fourth Edition (XPG4), 3
X/Open standards, 3
X/Open System Interface Extension (XSI), 4, 508
X/Open System Interface (XSI) specification, xv
xperfmon command, 356
XPG4 (X/Open Portability Guide, Fourth Edition), 3
XSI (X/Open System Interface Extension), 4, 508
XSI (X/Open System Interface) specification, xv
xtrace shell option, 174

Y[ Top ]
ypcat command, 453
ypmatch command, 453

Z[ Top ]
.Z file extension, 470
.z file extension, 470
-z test expression, 125, 393
ZDOTDIR variable, 410
zip command, 476
zsh (Z-Shell), 405, 410-412, 473
Z-shell (see zsh)

	

Zurück zu Classic Shell Scripting


Themen

Buchreihen

Special Interest

International Sites

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