sed & awk

Second Edition März 1997
ISBN 978-1-56592-225-9
Seiten 432
EUR34.00, SFR57.90


Weitere Informationen zu diesem Buch

Inhaltsverzeichnis | Index | Kolophon | Rezensionen |
Download der Beispiele |


Index

	
[ Symbols ], [ 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 ]
Symbols
& (ampersand)
   && (logical AND) operator, 158
   in replacement text, 81, 83
* (asterisk)
   ** (exponentiation) operator, 148
   **= (assignment) operator, 149
   *= (assignment) operator, 149
   as metacharacter, 28, 39-41
   multiplication operator, 148
\ (backslash), 147
   \<, \> escape sequences, 50, 265
   \`, \' escape sequences, 265
   character classes and, 35
   as metacharacter, 30-31
   in replacement text, 81-82
   (see also escape sequences, awk)
{} (braces)
   \{\} metacharacters, 30, 45
   in awk, 13, 20, 173
   grouping sed commands in, 61, 79
[] (brackets) metacharacters, 30, 34-39
[::] metacharacters, 38
[..] metacharacters, 38
[==] metacharacters, 38
^ (circumflex)
   ^= (assignment) operator, 149
   character classes and, 30, 37
   exponentiation operator, 148
   as metacharacter, 30, 43
   in multiline pattern space, 107
: (colon) for labels, 128
$ (dollar sign)
   as end-of-line metacharacter, 30, 43
   for last input line, 59
   in multiline pattern space, 107
$0, $1, $2, ..., 20, 143
. (dot) metacharacter, 28, 31, 40
= (equal sign)
   == (equal to) operator, 157
   for printing line numbers, 95
! (exclamation point), 59, 360
   != (not equal to) operator, 157
   !~ (does not match) operator, 145, 157-158
   branch command versus, 129
   csh and, 7
   logical NOT operator, 158
> (greater than sign)
   >= (greater than or equal to) operator, 157
   for redirection, 18, 62, 239
   relational operator, 157
- (hyphen)
   -= (assignment) operator, 149
   -- (decrement) operator, 149-150
   character classes and, 36-37
   subtraction operator, 148
< (less than sign)
   <= (less than or equal to) operator, 157
   relational operator, 157
# for comments, 80, 142, 368
   #n for suppressing output, 80
#!, invoking awk with, 252-254, 366
() (parentheses), 14, 30, 46
   with replacing text, 84
% (percent sign)
   %= (assignment) operator, 149
   for format specifications, 164
   modulo operator, 148
+ (plus)
   += (assignment) operator, 149
   ++ (increment) operator, 149-150
   addition operator, 148
   as metacharacter, 30, 41
   metacharacter, 141
? (question mark)
   ?: (conditional) operator, 174, 256
   as metacharacter, 30, 41
; (semicolon), 17, 21, 368
' (single quotes), 13, 16
/ (slash)
   /= (assignment) operator, 149
   // as delimiter, 11, 81
   division operator, 148
   in ed commands, 10
   pattern addressing, 9, 360
~ (match) operator, 145, 157-158
| (vertical bar)
   || (logical OR) operator, 158
   as metacharacter, 30, 46
   piping output with, 240

A[ Top ]
a command (sed), 87-90
abort statement (tawk), 274
acronym processor (example), 193-199
addition (+) operator, 148
addresses, line, 9, 12, 58-61, 78
   addressing by pattern, 9, 360
   printing with =, 95
adj script (example), 333-340
alignment of output fields, 165
ampersand (&)
   && (logical AND) operator, 158
   in replacement text, 81, 83
anchors, 30, 43
AND (&&) operator, 158
append command (see a command (sed))
ARGC variable, 199
ARGI variable (tawk), 275
ARGIND variable (gawk), 268
ARGV variable, 199
   ARGI variable with (tawk), 275
   ARGIND variable with (gawk), 268
arithmetic functions, 203-208, 258
arithmetic operators, awk, 148
arrays, 182-193, 257, 373
   deleting elements of, 193, 257, 259
   multidimensional, 196-199, 274
   parsing strings into elements, 190, 259
   sorting elements in (tawk), 274
   splitting, 259
   system variables that are, 199
   testing for membership in, 188
assigning input to variables, 230
assignment operators, awk, 149
associative arrays, 183-187
asterisk (*)
   ** (exponentiation) operator, 148
   **= (assignment) operator, 149
   *= (assignment) operator, 149
   as metacharacter, 28, 39-41
   multiplication operator, 148
automatic edits, 74-77
awk, 5, 12, 20-23, 255-259
   arrays (see arrays)
   built-in functions, 257
   built-in variables, 151-157, 258
   command-line syntax, 13, 365
   commands, 78, 375-381
      (see also under specific command)
   documentation for, xv
   error messages, 22
   escape sequences, 371
   extensions to, 259-262
   functions (see functions)
   invoking with #!, 252-254, 366
   limitations to, 251
   obtaining, xiii
   operators, 374
   options, 22
   POSIX standards for, 137
   programming model, 139
   quick reference, 365-381
   regular expression metacharacters, 369
   with sed, 23-25
   system variables, 373
   versions of, xiii, 262-277
   writing scripts in, 137-171
AWKPATH variable (gawk), 264

B[ Top ]
b command (sed), 128-130
\B escape sequence, 265
backreferences (see numbered replacement strings)
backslash (\), 147
   \<, \> escape sequences, 50, 265
   \`, \' escape sequences, 265
   character classes and, 35
   as metacharacter, 30-31
   in replacement text, 81-82
   (see also escape sequences, awk)
bang (!) (see exclamation point)
basic regular expressions (BREs), 38
BEGIN pattern
   command-line parameters and, 167
BEGIN procedure, 139, 257
BEGINFILE procedure (tawk), 273
beginning
   of line (see ^ (circumflex))
   of word (see \<, \> escape sequences)
Bell Labs awk, 262
BITFTP, xviii
blocks of text, 125-127
Boolean operators, awk, 158
   variables as Boolean patterns, 256
braces {}, 360
   \{\} metacharacters, 30, 45
   in awk, 13, 20, 173
   grouping sed commands in, 61, 79
bracket expressions, 34-39
brackets []
   [::] metacharacters, 38
   [..] metacharacters, 38
   [==] metacharacters, 38
   as metacharacters, 30, 34-39
branch command (see b command (sed))
branching, 128-131
break statement, 180
breaking lines, 265
BREs (basic regular expressions), 38
buffers, flushing, 260
built-in functions
   awk, 257
   gawk, 268
   tawk, 275
built-in variables, 151-157, 258

C[ Top ]
c command (sed), 87-90
capitalization, converting, 93, 121, 209, 214
case sensitivity, 28, 214
   character classes for, 34
   IGNORECASE variable (gawk), 268
   variable names, 147
   (see also capitalization, converting)
change command (see c command (sed))
character classes, 34-39
characters
   hiding special, 318
   matching at word start/end, 50
   measured span of, 30, 45
   metacharacters (see metacharacters)
   newline (see newline characters)
   range of (see character classes)
   space (see space characters)
   stripping non-printable nroff, 91-93
circumflex (^)
   ^= (assignment) operator, 149
   character classes and, 30, 37
   exponentiation operator, 148
   as metacharacter, 30, 43
   in multiline pattern space, 107
close(), 232, 241
closing files/pipes, 232, 241
closure, 41
collating symbols, 38
colon (:) for labels, 128
columns, output as, 243-246
combine script (example), 331-332
"command garbled" message, 17, 79
command-line options, gawk, 264
command-line parameters
   array of, 199-202
   passing into script, 166-168
command-line syntax, 13, 359, 365
commands, 21
   awk, 375-381
   executing expressions as, 233
   grouping, 61, 79
   menu-based generator (example), 235-239
   multiple, 21
   order of, 56-58
   sed, 78-79, 106, 361-364
   syntax for, 360
   (see also under specific command)
comments, 79, 142, 250, 368
commercial versions of awk, 272-277
comparing
   relationship operators for, 157-158
   strings, 215-218
concatenation, 27, 148
conditional statements, 172-174, 256
constants, 371
   hexadecimal (tawk), 275
continue statement, 180
continued lines, 265
converting, 191-193
   acronym processor (example), 193-199
   case, 214
   numbers to strings, 153
CONVFMT variable, 153, 185
copying programs, 247
cos(), 204
counters in for loops, 177
cross-referencing scheme, 2
csh shell, 7, 17
curly braces (see braces)
customizing functions, 218-226

D[ Top ]
d command (ed), 9
d command (sed), 59, 86, 121
D command (sed), 87, 112
   with P and N commands, 114
date and time (see time management)
debugging, 246-251
   print command with, 94
decrement (--) operator, 149-150
defining
   functions, 218-226
   variables, 147
delete command (see d command; D command (sed))
delete statement (awk), 193, 259
deleting
   array elements, 193, 257, 259
   lines, 9, 87, 112
delimiters, 152, 257
   awk, 21, 143-144, 146
   FIELDWIDTHS variable (gawk), 266
   FS variable, 144, 151, 259
   OFS variable, 152-153
   for regular expressions, 11, 81
   subscript-component, 196
/dev files, 260, 267
diff program, 62-64
division (/) operator, 148
do loop, 175-177
documentation, xv
   for masterindex script, 391
dollar sign ($), 30
   for last input line, 59
   as metacharacter, 43
   in multiline pattern space, 107
DOS versions of awk, xiv
dot (.) metacharacter, 28, 31, 40
dynamic regular expressions, 256

E[ Top ]
e (constant), 204
-e option (sed), 16, 19
ed editor, 8-12
edits, pipelined, 74-77
egrep program, 26
else statements (see if statements)
end of
   line (see $ (dollar sign))
   word (see \<, \> escape sequences)
END procedure, 257
ENDFILE procedure (tawk), 273
"Ending delimiter missing" error, 17
ENVIRON variable, 199, 202
environment variables, 202
equal sign (=)
   == (equal to) operator, 157
   for printing line numbers, 95
equivalence classes, 38
EREs (extended regular expressions), 38
ERRNO variable (gawk), 268
error messages, 261, 321
   awk, 22
   "command garbled", 17, 79
   "Ending delimiter missing" error, 17
   sed, 17
errors
   debugging, 246-251
   spelling, finding (example), 278-292
ESC character in vi, 91
escape sequences, awk, 147, 255, 371
escaping (see backslash)
example programs, xvi
exchange command (see x command (sed))
exclamation point (!), 59
   != (not equal to) operator, 157
   !~ (does not match) operator, 145, 157-158
   csh and, 7
   logical NOT operator, 158
   tilde (~) operator, 145
exit statement, 181
exp(), 204
exponentiation, 148, 204, 255
   ** operator, 148
   ^ operator, 148
expressions, 27-29, 371
   awk, 147-151
   executing as commands, 233
   regular (see regular expressions)
extended regular expressions (EREs), 38
extensions
   common awk, 259-262
   gawk, 263-272
   mawk, 272
   tawk, 273-276
extent of matching, 50-54
extracting file contents, 70-74

F[ Top ]
-f option (awk), 223, 264
-f option (sed), 14, 18-19
-F option (awk), 21, 144
factorials, 179-180
faking dynamic regular expressions, 256
FAQ on awk, xvi
fflush(), 260
field separators (see delimiters)
fields for awk records, 20, 143-146, 367
   formatting as output, 163-166
   NF variable, 152, 154
FIELDSWIDTHS variable (gawk), 266
File Transfer Protocol (FTP), xvii
files
   closing, 232, 241
   editing multiple, 69
   extracting contents from, 70-74
   filenames, special, 260
   getting information on, 159-163
   Interleaf, converting, 110-112
   multiple, 241-243
   multiple edits to, 64-69
   nextfile statement, 261
   reading from, 96-104, 169-171, 229
   scripts as (see scripts)
   search path for, 264
   special gawk, 267
   writing to, 18, 96-104, 239-243
fixed strings, 34
flags, 81
   g (global), 11, 80, 82
   numeric, 80, 82
   p (print), 80, 82
   w (write), 80, 82
flow control, 106, 127, 257
   branching, 128-130
   d command (sed), 87
   n command (sed), 95
flushing buffers, 260
FNR variable, 152, 230
for loop, 177-179, 184
formatting
   awk output, 163-166
   awk scripts, 367
   index (example program), 292-317
   system time, 270
FPAT variable (tawk), 275
Free Software Foundation (FSF), xiii
FS variable, 144, 146, 151, 259
FTP (File Transfer Protocol), xvii
Ftpmail, xvii
function keyword, 218
functions, 257, 375
   arithmetic, 203-208, 258
   creating library of, 223
   gawk, 268
   scope control (tawk), 274
   string-related, 208-218
   tawk, 275
   time-related (gawk), 270-272
   trigonometric, 204
   user-defined, 218-226

G[ Top ]
g command (ed), 10
G command (sed), 119, 124
g flag, 10, 80, 82
gawk (GNU awk), 252, 263-272
   built-in functions, 268
   built-in variables, 268
   multiple files and, 241
generating random numbers, 204-208
gensub(), 269
gent script, 346-347
get command (see G command (sed))
getline function, 235-239
getline function, 227-232, 257
global
   addressing, 58-61
   variables, 219
global command (see g command (ed))
glossary program (example), 188
GNU awk (see gawk)
GNU project, xiii
GNU sed, error messages, 18
greater than sign (>)
   >= (greater than or equal to) operator, 157
   for redirection, 18, 62, 239
   relational operator, 157
grep utility, 11, 70
gres program, 50
grouping operations (see parentheses)
grouping sed commands, 61, 79
gsub(), 209, 212-214, 269

H[ Top ]
h command (sed), 119-122
H command, 119
hexadecimal constants (tawk), 275
hexadecimal numbers, 147
hiding special characters, 318
hold command, 124
hold space, 119-127
   (see also pattern space)
hyphen (-)
   -= (assignment) operator, 149
   -- (decrement) operator, 149-150
   character classes and, 36-37
   subtraction operator, 148

I[ Top ]
i command (sed), 87-90
if statements, 172-174
IGNORECASE variable (gawk), 268
in operator, 188, 257
increment (++) operator, 149-150
index(), 209-210
index, array, 182, 185
index, formatting (example program), 292-317
INIT procedure (tawk), 273
input, 13
   assigning to variables, 230
   getline function, 227-232
insert command (see i command (sed))
instructions, awk, 20
int(), 204
Interleaf files, converting, 110-112
I/O (see input; output)

K[ Top ]
Korn shell, xiv

L[ Top ]
l command (sed), 90-93
labels, 128
length(), 209, 211
length, string, 211
less than sign (<)
   <= (less than or equal to) operator, 157
   relational operator, 157
library of functions, 223
limitations to awk, 251
limiting the match extent, 52
line addresses, 9, 12, 58, 78
   printing with =, 95
line editors, 8
lines
   continuing after breaks, 265
   deleting, 9, 87
   matching over multiple, 44
   matching start/end of, 43, 50
   parsing (see parsing)
   reading as input, 227-232
   terminating, 368
--lint, --lint-old options (gawk), 264
list command (see l command (sed))
local variables, 219
log(), 204
logging, timestamp with, 270
logical AND (&&) operator, 158
logical NOT (!) operator, 158
logical OR (||) operator, 158
loops, 139, 174-180
   arrays and, 182
   main input loop, 139
lowercase (see capitalization)
ls command (UNIX), 159-163

M[ Top ]
m1 script (example), 352-358
mailavg script (example), 332-333
main input loop, 139
masterindex script (example), 389-395
match(), 209, 215-218
match (~) operator, 145, 157-158
matching (see pattern matching)
math (see arithmetic functions; arithmetic operators; numbers)
mawk (Michael's awk), 252, 272
membership in arrays, 188
menu-based command generator (example), 235-239
metacharacters, 26, 30
   * (asterisk), 28, 39-41
   \ (backslash), 30-31
   \{\}, 30, 45
   [] (brackets), 30, 34-39
   ^ (circumflex), 30, 37
   $ (dollar sign), 30, 43
   . (dot), 28, 31, 40
   + (plus), 30, 41, 141
   ? (question mark), 30, 41
   | (vertical bar), 30, 46
   awk regular expression, 369
   inside brackets, 35
   replacement, 82-86
   sed regular expression, 360
   \< (start of word), 50, 265
   \> (end of word), 50, 265
-mf option (awk), 252
Michael's awk (see mawk)
MKS awk, 272
MKS Toolkit, xiv
modularization, 248
modulo (%) operator, 148
-mr option (awk), 252
multidimensional arrays, 196-199
   tawk and, 274
multiline
   delete command (see D command (sed))
   matching, 44
   next command (sed) (see N command (sed))
   pattern space, 107-116
   print command (see P command (sed))
   records, awk, 154
multiple
   awk commands, 21
   character ranges, 36
   conditional statements, 174
   edits to one file, 64-69
   files, 69, 241-243
multiplication (*) operator, 148

N[ Top ]
n command (sed), 95
N command (sed), 107-112
   with P and D commands, 114
\n escape sequence, 107
-n option (sed), 19, 80
names
   filenames, special, 260, 267
   script files, 14
nawk, 13
nested conditional statements, 174
newline characters, 30, 43, 81, 265
   . (dot) and, 31
   multiline pattern space and, 107-116
   ORS variable for, 152, 155
   in replacement strings, 82
   RS variable for, 152, 262, 275
newsgroup, awk, xvi
next command (sed) (see n command (sed); N command (sed))
next statement (awk), 181, 227
   (see also getline function)
nextfile statement, 261
NF variable, 152, 154, 230
non-English characters, 38
NOT (!) operator, 158
NR variable, 152-153, 183, 230
nroff, stripping non-printable characters, 91-93
numbered replacement strings, 84
numbers
   arithmetic functions, 203-208, 258
   comparing (relationship operators), 157-158
   converting to strings, 153
   factorials, 179-180
   hexadecimal, 147, 275
   limitations on, 251
   octal, 147
   output precision, 165
   random, 204-208
   truncating, 204
numeric flags, 80, 82

O[ Top ]
obtaining
   awk source code, xiii
   commercial awk versions, 272-273, 276
   examples, xvi
   gawk source code, 263
   mawk source code, 272
   sample programs, xvi
   sed source code, xiii
octal numbers, 147
octothorpe (#) for comments, 80, 142, 368
   #n for suppressing output, 80
OFMT variable, 153, 165
OFS variable, 152-153
operators, awk, 374
   arithmetic, 148
   assignment, 149
   Boolean, 158
   postfix versus prefix, 150
   relational, 157-158
options, 13, 16
   awk, 22
   combining, 19
   sed, 19
   (see also under specific option)
OR (||) operator, 158
order of operations, 27
   commands in scripts, 56-58
ORS variable, 152, 155
output, 13
   buffer, flushing, 260
   directing to files, 18, 239-243
   directing to pipes, 240
   formatting (awk), 163-166
   formatting into columns, 243-246
   saving, 61
   suppressing, 19, 80
   testing, 62-64
   to terminal, 260

P[ Top ]
p command (sed), 94
P command (sed), 114-116
   with N and D commands, 114
p flag, 80, 82
parameters, function, 218-219
parameters, script, 166-168
parentheses (), 14, 30, 46
   with replacing text, 84
parsing, 13
   referencing fields, 20, 143
   strings into array elements, 190, 259
pattern addressing, 9, 360
pattern matching, 5, 7, 14
   in awk, 141-143
   closure, 41
   extent of match, 50-54
   fixed strings, 34
   metacharacters for (see metacharacters)
   over multiple lines, 44
   phrases, 44
   at start/end of words, 50
   (see also regular expressions)
pattern space, 57-58, 119
   deleting contents of (see d command (sed))
   displaying (see l command (sed))
   inputing file into (see reading from files)
   insert and append commands and, 89
   multiline, 107-116
   (see also hold space)
patterns, 10, 14, 369
PCs, xiv
percent sign (%)
   %= (assignment) operator, 149
   for format specifications, 164
   modulo operator, 148
phonebill script (example), 328-330
phrase script (example), 133-136
phrases, 44
pipelined edits, 74-77
pipes
   closing, 232
   directing output to, 240
   limitations on, 251
   reading input from, 230-232
plpr script (example), 348-351
plus (+)
   += (assignment) operator, 149
   ++ (increment) operator, 149-150
   addition operator, 148
   as metacharacter, 30, 41
   metacharacter, 141
positional metacharacters, 43
POSIX
   awk (see awk)
   character class additions, 38, 370
   character classes standard, 38-39
   option conbinations, standard for, 19
   regular expressions standard, 38-39
   standard for labels, 128
--posix option (gawk), 264
postfix operators, 150
precedence, operation, 27, 374
precision modifier, 165
prefix operators, 150
print command (sed) (see p command; P command)
print statement (awk), 12, 139, 239
printerr(), 261, 321
printf statement, 163-166, 239
printing
   formatting output (awk), 163-166
   line addresses with =, 95
procedures, 14, 20
PROCINFO array (gawk), 267
programming
   awk, model for, 139
   sed, tips for, 77
prompts, 9

Q[ Top ]
q command (sed), 104-105
question mark (?)
   ?: (conditional) operator, 174, 256
   as metacharacter, 30, 41
quit command (see q command (sed))
quotation marks ('), 13, 16

R[ Top ]
r command (sed), 96-104
rand(), 204-208
random numbers, 204-208
range of characters (see character classes)
read command (see r command (sed))
reading, 227-232
   from files, 96, 229
   from pipe, 230-232
readsource script (example), 340-345
RECLEN variable (tawk), 275
records, awk, 20, 143-146, 367
   arrays and, 182
   fixed-length (tawk), 275
   multiline, 154
   NF variable, 152, 154
   NR variable, 152-153, 183, 230
   RT variable (gawk), 266
   separators for (see delimiters)
redirection, 18, 62, 239
references, xv
referencing fields, 20, 143
regular expressions, 7, 26-54, 369
   as constants, 158
   delimiters for, 11, 81
   dynamic, faking, 256
   ed and, 9
   examples of, 54
   gawk extensions to, 265
   metacharacters for (see netacharacters)
   POSIX standard for, 38-39
   RS variable as, 262, 275
   tawk and, 274
   union of, 30, 46
   writing, 32-34
   (see also pattern matching)
--re-interval option (gawk), 264
relational expressions, 369
relational operators, 157-158
replacement metacharacters, 82-86
   numbered saves, 84
replacing text, 3, 50-54
retrieving data from files, 169-171
return statement, 218, 221
revision control systems, 247
RS variable, 152, 262, 275
RT variable (gawk), 266
rules, matching (see pattern matching)

S[ Top ]
s command (ed), 10
s command (sed), 80-86
sample programs, xvi
saving output, 18, 61, 239
scope control (tawk), 274
scripts, 11, 13-14, 366
   debugging, 246-251
   examples of, 324-358
   as files, 18
   format of, 367
   modularizing, 248
   names for, 14
   passing parameters to, 166-168
   phrase (example script), 133-136
   stopping, sed (see q command (sed))
search path for awk files, 264
search-and-replace, 3
   matching extent, 50-54
sed, 3, 15-19
   with awk, 23-25
   command-line syntax, 13, 359
   commands, 78-79, 106
      syntax of, 78
      (see also under specific command)
   commands for, 361-364
   documentation for, xv
   ed versus, 11
   error messages, 17
   obtaining, xiii
   options, 16, 19
      (see also under specific option)
   programming tips for, 77
   quick reference, 359-364
   regular expression metacharacters, 360
semicolon (;), 17, 21, 368
shell scripts (see scripts)
shells, 7, 17
   (see also under specific shell name)
sin(), 204
single quotation marks ('), 13, 16
slash (/)
   /= (assignment) operator, 149
   // as delimiter, 11, 81
   division operator, 148
   in ed commands, 10
sort function (example), 221-226
sort program, 25
sorting array elements (tawk), 274
source code, obtaining (see obtaining)
--source option (gawk), 264
space characters, 16, 79
   as awk delimiters, 21, 146
   as string concatenator, 148
span, character, 30, 45
special characters, 16, 26
   (see also escape sequences, awk; metacharacters)
special filenames, 260, 267
spell checker program (example), 278-292
spellcheck.awk program, 382-389
split(), 190, 209, 260
sprintf(), 209
sqrt(), 204
srand(), 204-208
standard input/output, 13
start of
   line (see ^ (circumflex))
   word (see \<, > escape sequences)
statements, awk, 375
stopping sed scripts (see q command (sed))
stream editor, 3, 12, 74
strftime(), 270
strings, 28, 147
   comparing, 215-218
   concatenating, 148
   converting from numbers, 153
   fixed (see fixed strings)
   functions for, 208-218
   length of, 211
   limitations on, 251
   parsing into array elements, 190, 259
   substitution functions (awk), 212-214, 269
   substrings, 210
stripping non-printable characters, 91-93
sub(), 209, 212-214, 269
SUBSEP variable, 196
substitute command (see s command)
substituting text (sed), 10, 80-86
   relacement metacharacters, 82-86
   (see also s command (sed))
substitution functions (awk), 212-214, 269
substr(), 209-210, 260
substrings (see strings)
subtraction (-) operator, 148
suppressing output, 19, 80
syntax
   command-line, 13, 359, 365
   sed commands, 78
system(), 233-239
system time, 270
system variables, 151-157, 199-202, 373
   gawk, 268
systime(), 270

T[ Top ]
t command (sed), 130
tawk, 273-276
terminal, user, 260
terminating lines, 368
terminator, record, 266
test command (see t command (sed))
testing
   for membership in arrays, 188
   output, 62-64
text blocks, 125-127
Thompson Automation awk (tawk), 273-276
tilde (~) operator, 145, 157-158
time management, 270-272
tolower(), 209, 214
toupper(), 209, 214
--traditional option (gawk), 264
transform command (see y command (sed))
transpose script (example), 351-352
trigonometric functions, 204
truncating numbers, 204

U[ Top ]
union metacharacter, lack of, 46
union of regular expressions, 30, 46
uppercase (see capitalization)
user-defined functions, 218-226
UUCP, xix
uutot.awk script (example), 325-327

V[ Top ]
-v option (awk), 168, 236
variables, 147, 372
   arrays (see arrays)
   assigning input to, 230
   as Boolean patterns, 256
   built-in, 151-157, 258
      gawk, 268
   environment, 202
   local vs. global, 219
   scope control (tawk), 274
   system (see system variables)
verifying (see testing)
versions, awk, xiii, 255-259, 262-277
vertical bar (|)
   as metacharacter, 30, 46
   piping output with, 240
vi editor, 90-91
Videosoft VSAwk, 276
Visual Basic, awk for, 276

W[ Top ]
w command (sed), 96-104
\w escape sequence, 265
\W escape sequence, 265
w flag, 80, 82
while loop, 175
whitespace (see space characters)
width, output field, 165
wildcard metacharacter (see . (dot))
write command (see w command (sed))
writing
   from files, 98-104
   to files, 18, 96, 239-243
   regular expressions, 32-34
   scripts, 7
      awk, 137-171
      sed, 55-77
   user-defined functions, 218-226

X[ Top ]
x command (sed), 120, 124, 126

Y[ Top ]
y command (sed), 93
\y escape sequence, 265

	

Zurück zu sed & awk


Themen

Buchreihen

Special Interest

International Sites

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