%!PS-Adobe-1.0 %%Creator: devps (Pipeline Associates, Inc.) %%CreationDate: Fri Sep 13 14:26:35 1996 %%Pages: (atend) %%DocumentFonts: (atend) /devps 180 dict def devps begin /res 10.000000 def /y_offset 843 def /X{exch}bind def /mm {transform round X round X itransform} bind def /r{rmoveto}bind def /m{moveto}bind def /l{lineto}bind def /rl{rlineto}bind def /st{stroke}bind def /gs{gsave}bind def /gr{grestore}bind def /cp{currentpoint}bind def /np{newpath}bind def /ct{curveto}bind def systemdict /setpacking known { /savepacking currentpacking def true setpacking } if /m0{0 0 moveto}bind def /xc{//res div}bind def /yc{//res neg div //y_offset add}bind def /lc{yc X xc X l st}bind def /mc{yc X xc X m}bind def /el{gs /a X def a div 1 X scale cp np a xc 2 div 0 360 arc st gr}bind def /ar{cp 7 2 roll np xc 5 1 roll atan 3 1 roll atan X arc st}bind def /sp{yc X xc X 6 2 roll yc X xc X 6 2 roll yc X xc X 6 2 roll ct}bind def /V{//res neg div //y_offset add currentpoint pop X m}bind def /H{//res div 0 transform X round X itransform pop currentpoint X pop moveto}bind def /h{//res div 0 r}bind def /v{//res neg div 0 X r}bind def /S{X H show}bind def /A{H //res div 1 index stringwidth pop sub 1 index length div 0 3 2 roll ashow}bind def /psize 10 def /height 0 def /cheight { height 0 ne { height } { psize } ifelse } bind def /slant 0 def /FF{findfont X dup 30 div 0 mm pop setlinewidth /psize X def [psize 0 cheight slant sin slant cos div mul cheight 0 0] makefont setfont}bind def /shade{gs /dy X def /dx X def np m 0 /dy rl /dx 0 rl 0 /dy neg rl /dx neg 0 rl closepath .9 setgray fill gr}bind def 1 setlinecap /resolution res 72 mul def /startFig { /SavedState save def userdict maxlength dict begin currentpoint transform DocumentInitState setmiterlimit setgray setdash setlinejoin setlinecap setlinewidth setmatrix itransform moveto /ury exch def /urx exch def /lly exch def /llx exch def /y exch 72 mul resolution div def /x exch 72 mul resolution div def currentpoint /cy exch def /cx exch def /sx x urx llx sub div def /sy y ury lly sub div def sx sy scale cx sx div llx sub cy sy div ury sub translate /DefFigCTM matrix currentmatrix def /initmatrix { DefFigCTM setmatrix } def /defaultmatrix { DefFigCTM exch copy } def /initgraphics { DocumentInitState setmiterlimit setgray setdash setlinejoin setlinecap setlinewidth setmatrix DefFigCTM setmatrix } def /showpage { initgraphics } def }bind def /clipFig { currentpoint 6 2 roll newpath 4 copy 4 2 roll moveto 6 -1 roll exch lineto exch lineto exch lineto closepath clip newpath moveto }bind def /doclip { llx lly urx ury clipFig } def /endFig { end SavedState restore }bind def /globalstart { fontnum psize slant height resolution currentpoint pagesave restore gsave }bind def /globalend { grestore moveto /resolution exch def /height exch def /slant exch def /psize exch def /fontnum exch def F /pagesave save def }bind def /fontnum 1 def systemdict /setpacking known { savepacking setpacking} if end /BP{ save mark devps begin m0 /DocumentInitState [ matrix currentmatrix currentlinewidth currentlinecap currentlinejoin currentdash currentgray currentmiterlimit ] cvx def }bind def /EP{ end cleartomark restore showpage}def /R{/Times-Roman FF}def /B{/Times-Bold FF}def /I{/Times-Italic FF}def /L{/Helvetica FF}def %%EndProlog %%Page: 1 1 BP /slant 0 def /height 0 def 858 V 12 B 936(Command:)S 1584(awk)S 1829(\261)S 1919(pattern)S 2333(matching)S 2847(language)S 996 V 936(Syntax:)S 1584(awk)S 12 I 1829(rules)S 12 R 2101([)S 12 I 2142(\256le)S 12 R 2290(])S (...)90 2361 A 1134 V 12 B 936(Flags:)S 12 R (\(none\))316 1584 A 1272 V 12 B 936(Examples:)S 12 R 1584(awk)S 1816(rules)S (input)248 2082 A 2916(#)S 3006(Process)S 12 I (input)248 3406 A 12 R (according)477 3684 A 4191(to)S 12 I 4315(rules)S 1410 V 12 R 1584(awk)S 1816(rules)S 2082(\261)S 2202(>out)S 2916(#)S (Input)255 3006 A 3291(from)S 3557(terminal,)S 4022(output)S 4360(to)S 12 I 4484(out)S 1584 V 12 R 1116(AWK)S 1442(is)S 1560(a)S 1651(programming)S (language)436 2346 A 2819(devised)S 3225(by)S 3382(Aho,)S 3657(Weinberger,)S 4296(and)S 4507(Kernighan)S 1722 V 936(at)S 1061(Bell)S 1300(Labs)S 1572(\(hence)S 1932(the)S 2117(name\).)S 12 I 2517(Awk)S 12 R 2762(programs)S 3256(search)S 3602(\256les)S 3840(for)S 4018(speci\256c)S 4424(patterns)S 4844(and)S 1860 V 936(performs)S 1425(`)S 1456(`actions')S 1871(')S 1963(for)S 2156(every)S 2476(occurrence)S 3059(of)S 3211(these)S 3512(patterns.)S 4008(The)S 4248(patterns)S 4684(can)S 4904(be)S 1998 V 936(`)S 967(`regular)S 1394(expressions')S 1989(')S 2072(as)S 2215(used)S 2478(in)S 2613(the)S 12 I 2802(ed)S 12 R 2957(editor.)S 3341(The)S 3570(actions)S 3954(are)S 4144(expressed)S 4662(using)S 4964(a)S 2136 V 936(subset)S 1268(of)S 1399(the)S 1577(C)S (language.)466 1687 A 2310 V 1116(The)S 1343(patterns)S 1766(and)S 1979(actions)S 2361(are)S 2549(usually)S (placed)316 2937 A 3292(in)S 3425(a)S 3518(`)S 3549(`rules')S 3857(')S 3937(\256le)S 4132(whose)S 4481(name)S 4783(must)S 2448 V 936(be)S 1088(the)S 1273(\256rst)S 1499(argument)S 1993(in)S 2124(the)S 2309(command)S 2822(line,)S (preceded)437 3071 A 3545(by)S 3702(the)S 3887(\257ag)S 12 B 4105(\261f)S 12 R 4206(.)S 4303(Otherwise,)S 4870(the)S 2586 V 936(\256rst)S 1155(argument)S 1642(on)S 1792(the)S 1970(command)S 2476(line)S 2688(is)S 2799(taken)S 3091(to)S 3215(be)S 3359(a)S 3443(string)S 3749(containing)S 4289(the)S 4468(rules)S 4735(them-)S 2724 V 936(selves.)S 1293(All)S 1480(other)S 1760(arguments)S 2295(are)S 2475(taken)S 2768(to)S 2892(be)S 3036(the)S 3214(names)S 3553(of)S 3684(text)S 3896(\256les)S 4128(on)S 4278(which)S 4604(the)S 4782(rules)S 2862 V 936(are)S 1122(to)S 1253(be)S 1404(applied,)S 1827(with)S 12 B 2080(\261)S 12 R 2177(being)S 2482(the)S 2668(standard)S (input.)278 3116 A 3462(To)S 3634(take)S 3874(rules)S 4148(from)S 4422(the)S 4608(standard)S 3000 V (input,)278 936 A 1244(use)S 12 B 1435(\261f)S 1566(\261)S 12 R 1626(.)S 3174 V 1116(The)S 1334(command:)S 3381 V 10 L 1086(awk)S 1321(rules)S 1596(prog.)S 3431 V 12 L 1826(*)S 3588 V 12 R 936(would)S 1278(read)S 1527(the)S 1715(patterns)S 2139(and)S 2353(actions)S 2736(rules)S 3012(from)S 3288(the)S 3476(\256le)S 12 I 3671(rules)S 12 R 3954(and)S 4169(apply)S 4478(them)S 4761(to)S 4896(all)S 3726 V 936(the)S 1114(arguments.)S 3900 V 1116(The)S 1334(general)S 1721(format)S 2075(of)S 2206(a)S 2290(rules)S 2556(\256le)S 2741(is:)S 4107 V 1026()S 1529({)S 1617()S 2079(})S 2257()S 2760({)S 2848()S 3310(})S (...)90 3488 A 4314 V 936(There)S 1261(may)S 1511(be)S 1667(any)S 1883(number)S 2294(of)S 2437(these)S 2728()S 3244({)S 3345()S 3820(})S 3921(sequences)S 4454(in)S 4591(the)S 4782(rules)S 4452 V 936(\256le.)S 12 I 1194(Awk)S 12 R 1445(reads)S 1744(a)S 1841(line)S 2066(of)S (input)248 2210 A 2501(from)S 2780(the)S 2971(current)S (input)248 3358 A 3649(\256le)S 3847(and)S 4064(applies)S 4450(every)S 4761()S 1223({)S 1311()S 1773(})S 1861(in)S 1985(sequence)S 2458(to)S 2582(the)S 2760(line.)S 4764 V 1116(If)S 1250(the)S 1450()S (corresponding)691 1975 A 2718(to)S 2864(any)S 3090({)S 3200()S 3684(})S 3794(is)S 3928(missing,)S 4387(the)S 4588(action)S 4937(is)S 4902 V 936(applied)S 1323(to)S 1448(every)S 1748(line)S 1961(of)S (input.)278 2093 A 2432(The)S 2651(default)S 3019({)S 3108()S 3570(})S 3658(is)S 3769(to)S 3893(print)S 4152(the)S 4330(matched)S (input)248 4770 A 5040 V 936(line.)S 5316 V 12 B 936(Patterns)S 5628 V 12 R 1116(The)S 1336(s)S 1888(may)S 2128(consist)S 2496(of)S 2629(any)S 2835(valid)S 3110(C)S 3223(expression.)S 3833(If)S 3948(the)S 4129()S 4635(consists)S 5766 V 936(of)S 1070(two)S 1285(expressions)S 1882(separated)S 2373(by)S 2526(a)S 2613(comma,)S 3032(it)S 3133(is)S 3247(taken)S 3541(to)S 3667(be)S 3813(a)S 3899(range)S 4200(and)S 4406(the)S 4586()S 5904 V 936(is)S 1066(performed)S 1620(on)S 1789(all)S 1960(lines)S 2238(of)S (input)248 2388 A 2685(that)S 2916(match)S 3261(the)S 3458(range.)S 3836(s)S 4405(may)S 4662(contain)S 6042 V 936(`)S 967(`regular)S 1411(expressions')S 2006(')S 2106(delimited)S 2622(by)S 2800(an)S 2972(@)S 3142(symbol.)S 3615(Regular)S 4056(expressions)S 4678(can)S 4904(be)S 6180 V (thought)368 936 A 1341(of)S 1479(as)S 1617(a)S 1708(generalized)S 2304(`)S 2335(`wildcard')S 2832(')S 2910(string)S 3223(matching)S 3710(mechanism,)S 4328(similar)S 4704(to)S 4836(that)S 6318 V 936(used)S 1204(by)S 1371(many)S 1686(operating)S 2190(systems)S 2619(to)S 2759(specify)S 3155(\256le)S 3356(names.)S 3771(Regular)S 4200(expressions)S 4810(may)S 6456 V 936(contain)S 1322(any)S 1526(of)S 1657(the)S 1835(following)S 2336(characters:)S 6663 V 1116(x)S 1476(An)S 1654(ordinary)S 2094(character)S 6801 V 1116(\\)S 1476(The)S 1694(backslash)S (quotes)315 2194 A 2539(any)S 2743(character)S 6939 V 1116(\303)S 1476(A)S 1594(circum\257ex)S 2142(at)S 2260(the)S 2438(beginning)S 2950(of)S 3081(an)S 3225(expr)S 3470(matches)S 3897(the)S 4075(beginning)S 4587(of)S 4718(a)S 4802(line.)S 7077 V 1116($)S 1476(A)S 1594(dollar-sign)S 2149(at)S 2267(the)S 2445(end)S 2649(of)S 2780(an)S 2924(expression)S 3471(matches)S 3898(the)S 4076(end)S 4280(of)S 4411(a)S 4495(line.)S 8427 V EP %%Page: 2 2 BP /slant 0 def /height 0 def 1130 V 12 B 936(2)S 1380 V 12 R 1116(.)S 1476(A)S 1594(period)S 1933(matches)S 2360(any)S 2564(single)S 2883(character)S 3359(except)S 3705(newline.)S 1518 V 1116(*)S 1476(An)S 1654(expression)S 2201(followed)S 2662(by)S 2812(an)S 2957(asterisk)S 3359(matches)S 3787(zero)S 4027(or)S 4159(more)S 4439(occurrences)S 1656 V 1476(of)S 1607(that)S 1819(expression:)S 2400(`)S 2431(`fo*')S 2664(')S 2735(matches)S 3162(`)S (`f')123 3193 A 3306(',)S 3407(`)S 3438(`fo')S 3611(',)S 3712(`)S 3743(`foo')S 3976(',)S 4077(`)S (`fooo')303 4108 A 4401(',)S 4502(etc.)S 1794 V 1116(+)S 1476(An)S 1657(expression)S 2207(followed)S 2671(by)S 2824(a)S 2912(plus)S 3147(sign)S 3382(matches)S 3813(one)S 4021(or)S 4156(more)S 4439(occurrences)S 1932 V 1476(of)S 1607(that)S 1819(expression:)S 2400(`)S 2431(`fo+')S 2672(')S 2743(matches)S 3170(`)S 3201(`fo')S 3374(',)S 3475(`)S 3506(`foo')S 3739(',)S 3840(`)S (`fooo')303 3871 A 4164(',)S 4265(etc.)S 2070 V 1116([])S 1476(A)S 1596(string)S 1904(enclosed)S 2359(in)S 2485(square)S 2834(brackets)S 3271(matches)S 3701(any)S 3908(single)S 4230(character)S 4709(in)S 4836(that)S 2208 V 1476(string,)S 1824(but)S 2020(no)S 2182(others.)S 2580(If)S 2704(the)S 2894(\256rst)S 3125(character)S 3612(in)S 3747(the)S 3936(string)S 4253(is)S 4375(a)S 4470(circum\257ex,)S 2346 V 1476(the)S 1662(expression)S 2217(matches)S 2652(any)S 2864(character)S 3348(except)S 3702(newline)S 4125(and)S 4338(the)S 4525(characters)S 2484 V 1476(in)S 1621(the)S 1820(string.)S 2207(For)S 2425(example,)S 2915(`)S 2946(`[xyz]')S 3274(')S 3365(matches)S 3812(`)S 3843(`xx')S 4035(')S 4126(and)S 4350(`)S 4381(`zyx')S 4627(',)S 4748(while)S 2622 V 1476(`)S (`[\303xyz]')379 1507 A 1876(')S 1956(matches)S 2392(`)S 2423(`abc')S 2663(')S 2743(but)S 2936(not)S 3129(`)S 3160(`axb')S 3406('.)S 3546(A)S 3673(range)S 3982(of)S 4123(characters)S 4656(may)S 4904(be)S 2760 V 1476(speci\256ed)S 1936(by)S 2086(two)S 2298(characters)S 2821(separated)S 3309(by)S 3459(`)S (`-')123 3490 A 3603('.)S 3036 V 12 B 936(Actions)S 3348 V 12 R 1116(Actions)S 1537(are)S 1730(expressed)S 2251(as)S 2396(a)S 2494(subset)S 2840(of)S 2985(the)S 3177(C)S (language.)466 3301 A 3841(All)S 4041(variables)S 4523(are)S 4716(global)S 3486 V 936(and)S 1147(default)S 1521(to)S 1651(int's)S 1903(if)S 2014(not)S 2204(formally)S 2658(declared.)S 3135(Only)S 3413(char's)S 3746(and)S 3956(int's)S 4208(and)S 4418(pointers)S 4844(and)S 3624 V 936(arrays)S 1266(of)S 1400(char)S 1642(and)S 1849(int)S 2010(are)S 2192(allowed.)S 12 I 2669(Awk)S 12 R 2910(allows)S 3260(only)S 3507(decimal)S 3924(integer)S 4294(constants)S 4777(to)S 4904(be)S 3762 V 936(used\320no)S 1434(hex)S (\(0xnn\))322 1645 A 2004(or)S 2142(octal)S (\(0nn\).)292 2415 A 2744(String)S 3077(and)S 3288(character)S 3771(constants)S 4258(may)S 4503(contain)S 4896(all)S 3900 V 936(of)S 1067(the)S 1245(special)S 1612(C)S 1722(escapes)S 2122(\(\\n,)S 2317(\\r,)S 2452(etc.\).)S 4074 V 12 I 1116(Awk)S 12 R (supports)409 1355 A 1795(the)S 1974(`)S 2005(`if')S 2152(',)S 2254(`)S 2285(`else')S 2546(',)S 2648(`)S 2679(`while')S 3021(')S 3093(and)S 3298(`)S 3329(`break')S 3670(')S 3742(\257ow)S 3989(of)S 4122(control)S 4497(constructs,)S 4212 V 936(which)S 1262(behave)S 1634(exactly)S 2014(as)S 2145(in)S 2269(C.)S 4386 V 1116(Also)S (supported)476 1397 A 1925(are)S 2126(the)S 2326(following)S 2849(unary)S 3176(and)S 3403(binary)S 3765(operators,)S 4299(listed)S 4615(in)S 4762(order)S 4524 V 936(from)S 1202(highest)S 1581(to)S 1705(lowest)S (precedence:)579 2052 A 4731 V 12 B 1116(Operator)S 2196(Type)S 3096(Associativity)S 4869 V 12 R 1116(\(\))S 1228([])S 2196(unary)S 3096(left)S 3289(to)S 3413(right)S 5007 V 1116(!)S 1187(\304)S 1258(++)S 1424(\261\261)S 1574(\261)S 1664(*)S 1754(&)S 2196(unary)S 3096(right)S 3355(to)S 3479(left)S 5145 V 1116(*)S 1206(/)S 1270(%)S 2196(binary)S 3096(left)S 3289(to)S 3413(right)S 5283 V 1116(+)S 1214(\261)S 2196(binary)S 3096(left)S 3289(to)S 3413(right)S 5421 V 1116(<<)S 1282(>>)S 2196(binary)S 3096(left)S 3289(to)S 3413(right)S 5559 V 1116(<)S 1214(<=)S 1380(>)S 1478(>=)S 2196(binary)S 3096(left)S 3289(to)S 3413(right)S 5697 V 1116(==)S 1282(!=)S 2196(binary)S 3096(left)S 3289(to)S 3413(right)S 5835 V 1116(&)S 2196(binary)S 3096(left)S 3289(to)S 3413(right)S 5973 V 1116(\303)S 2196(binary)S 3096(left)S 3289(to)S 3413(right)S 6111 V 1116(|)S 2196(binary)S 3096(left)S 3289(to)S 3413(right)S 6249 V 1116(&&)S 2196(binary)S 3096(left)S 3289(to)S 3413(right)S 6387 V 1116(||)S 2196(binary)S 3096(left)S 3289(to)S 3413(right)S 6525 V 1116(=)S 2196(binary)S 3096(right)S 3355(to)S 3479(left)S 6732 V 936(Comments)S 1500(are)S (introduced)517 1690 A 2248(by)S 2409(a)S 2504('#')S 2687(symbol)S 3083(and)S 3299(are)S 3490(terminated)S 4051(by)S 4213(the)S 4403(\256rst)S 4634(newline)S 6870 V 936(character.)S 1482(The)S 1710(standard)S 2160(`)S 2191(`/*')S 2357(')S 2438(and)S 2652(`)S 2683(`*/')S 2849(')S 2930(comment)S 3420(delimiters)S 3946(are)S 4135(not)S (supported)476 4329 A 4844(and)S 7008 V (will)190 936 A 1156(result)S 1456(in)S 1580(a)S 1664(syntax)S 2009(error.)S 8427 V EP %%Page: 3 3 BP /slant 0 def /height 0 def 1130 V 12 B 4958(3)S 1380 V 936(Fields)S 1761 V 12 R 1116(When)S 12 I 1447(awk)S 12 R 1684(reads)S 1983(a)S 2080(line)S 2306(from)S 2586(the)S 2778(current)S (input)248 3166 A 3458(\256le,)S 3687(the)S 3879(record)S 4233(is)S 4358(automatically)S 1899 V 936(separated)S 1432(into)S 1657(`)S 1688(`\256elds.')S 2052(')S 2160(A)S 2285(\256eld)S 2537(is)S 2655(simply)S 3021(a)S 3112(string)S 3425(of)S 3563(consecutive)S 4171(characters)S 4701(delim-)S 2037 V 936(ited)S 1164(by)S 1330(either)S 1653(the)S 1847(beginning)S 2375(or)S 2522(end)S 2742(of)S 2889(line,)S 3147(or)S 3294(a)S 3394(`)S 3425(`\256eld)S 3727(separator')S 4203(')S 4290(character.)S 4842(Ini-)S 2175 V 936(tially,)S 1251(the)S 1433(\256eld)S 1682(separators)S 2208(are)S 2391(the)S (space)269 2573 A 2876(and)S 3084(tab)S 3266(character.)S 3806(The)S 4028(special)S 4399(unary)S 4708(opera-)S 2313 V 936(tor)S 1109('$')S 1289(is)S 1408(used)S 1667(to)S 1799(reference)S 2290(one)S 2502(of)S 2641(the)S 2827(\256elds)S 3128(in)S 3261(the)S 3448(current)S (input)248 3831 A 4118(record)S 4467(\(line\).)S 4830(The)S 2451 V 936(\256elds)S 1236(are)S 1423(numbered)S 1944(sequentially)S 2567(starting)S 2969(at)S 3095(1.)S 3253(The)S 3478(expression)S 4032(`)S 4063(`$0')S 4255(')S 4333(references)S 4870(the)S 2589 V 936(entire)S (input)248 1243 A 1521(line.)S 2763 V 1116(Similarly,)S 1656(the)S 1863(`)S 1894(`record)S 2304(separator')S 2780(')S 2880(is)S 3020(used)S 3300(to)S 3453(determine)S 3997(the)S 4204(end)S 4437(of)S 4597(an)S (input)248 4770 A 2901 V 936(`)S 967(`line,')S 1251(')S (initially)378 1348 A 1782(the)S 1986(newline)S 2426(character.)S 2987(The)S 3230(\256eld)S 3500(and)S 3729(record)S 4094(separators)S 4641(may)S 4904(be)S 3039 V 936(changed)S 1398(programatically)S 2227(by)S 2408(one)S 2643(of)S 2805(the)S 3014(actions)S 3418(and)S (will)190 3653 A 3904(remain)S 4302(in)S 4457(effect)S (until)222 4796 A 3177 V 936(changed)S 1368(again.)S 3351 V (Multiple)417 1116 A 1575(\(up)S 1778(to)S 1914(10\))S 2117(\256eld)S 2374(separators)S 2908(are)S 3099(allowed)S 3525(at)S 3655(a)S 3751(time,)S 4039(but)S 4235(only)S 4491(one)S 4708(record)S 3489 V 936(separator.)S 3663 V 1116(Fields)S 1461(behave)S 1852(exactly)S 2251(like)S 2482(strings;)S 2889(and)S 3113(can)S 3331(be)S 3495(used)S 3766(in)S 3910(the)S 4108(same)S 4407(context)S 4813(as)S 4964(a)S 3801 V 936(character)S 1412(array.)S 1752(These)S 2071(`)S 2102(`arrays')S 2471(')S 2542(can)S 2740(be)S 2884(considered)S 3438(to)S 3562(have)S 3820(been)S 4078(declared)S 4519(as:)S 4028 V 1086(char)S 1325(\($n\)[)S (128)180 1598 A 1808(];)S 4255 V 936(In)S 1075(other)S 1362(words,)S 1726(they)S 1972(are)S (128)180 2159 A 2377(bytes)S (long.)244 2671 A 2984(Notice)S 3347(that)S 3568(the)S 3755(parentheses)S 4359(are)S (necessary)471 4547 A 4393 V (because)383 936 A 1358(the)S 1545(operators)S 2035([])S 2156(and)S 2368($)S 2466(associate)S 2942(from)S 3216(right)S 3483(to)S 3615(left;)S (without)370 3850 A 4258(them,)S 4568(the)S 4754(state-)S 4531 V 936(ment)S 1208(would)S 1540(have)S 1798(parsed)S 2144(as:)S 4758 V 1086(char)S 1325($\(1[)S (128)180 1557 A 1767(]\);)S 4985 V 936(which)S 1262(is)S (obviously)475 1373 A 1878(ridiculous.)S 5159 V 1116(If)S 1235(the)S 1421(contents)S 1862(of)S 2001(one)S 2213(of)S 2352(these)S 2639(\256eld)S 2892(arrays)S 3227(is)S 3346(altered,)S 3745(the)S 3931(`)S 3962(`$0')S 4154(')S 4233(\256eld)S (will)190 4486 A 4714(re\257ect)S 5297 V 936(this)S 1141(change.)S 1573(For)S 1771(example,)S 2241(this)S 2446(expression:)S 5524 V (*$4)180 1086 A 1296(=)S 1394('A';)S 5751 V (will)190 936 A 1160(change)S 1536(the)S 1718(\256rst)S 1941(character)S 2421(of)S 2556(the)S 2738(fourth)S 3068(\256eld)S 3317(to)S 3445(an)S (upper-)316 3594 A 3945(case)S 4189(letter)S 4475('A'.)S 4740(Then,)S 5889 V 936(when)S 1228(the)S 1406(following)S (input)248 1907 A 2185(line:)S 6116 V (120)180 1086 A 1296(PRINT)S 1676("Name)S 2285(address)S 2888(Zip")S 6343 V 936(is)S 1047(processed,)S 1584(it)S 1682(would)S 2014(be)S 2158(printed)S 2531(as:)S 6570 V (120)180 1086 A 1296(PRINT)S 1676("Name)S 2285(Address)S 2922(Zip")S 6797 V 936(Fields)S 1273(may)S 1522(also)S 1758(be)S 1913(modi\256ed)S 2383(with)S 2640(the)S 2829(strcpy\(\))S 3248(function)S 3692(\(see)S 3929(below\).)S 4368(For)S 4578(example,)S 6935 V 936(the)S 1114(expression:)S 7142 V 1086(strcpy\()S 1453($4,)S 1633("Addr.")S 2040(\);)S 8427 V EP %%Page: 4 4 BP /slant 0 def /height 0 def 1130 V 12 B 936(4)S 1380 V 12 R 936(applied)S 1322(to)S 1446(the)S 1624(same)S 1903(line)S (above)288 2115 A 2433(would)S 2765(yield:)S 1587 V (120)180 1086 A 1296(PRINT)S 1676("Name)S 2285(Addr.)S 2804(Zip")S 1932 V 12 B 936(Prede\256ned)S 1524(Variables)S 2244 V 12 R 1116(The)S 1334(following)S 1835(variables)S 2303(are)S 2482(pre-de\256ned:)S 2451 V 1116(FS)S 2016(Field)S 2295(separator)S 2770(\(see)S 2996(below\).)S 2589 V 1116(RS)S 2016(Record)S 2395(separator)S 2870(\(see)S 3096(below)S 3422(also\).)S 2727 V 1116(NF)S 2016(Number)S 2443(of)S 2574(\256elds)S 2866(in)S 2990(current)S (input)248 3364 A 3642(record)S 3982(\(line\).)S 2865 V 1116(NR)S 2016(Number)S 2443(of)S 2574(records)S 2961(processed)S 3468(thus)S 3699(far.)S 3003 V 1116(FILENAME)S 2016(Name)S 2336(of)S 2467(current)S (input)248 2841 A 3119(\256le.)S 3141 V 1116(BEGIN)S 2016(A)S 2134(special)S 2501()S 3004(that)S 3216(matches)S 3643(the)S 3821(beginning)S 4333(of)S (input)248 4464 A 4742(text.)S 3279 V 1116(END)S 2016(A)S 2134(special)S 2501()S 3004(that)S 3216(matches)S 3643(the)S 3821(end)S 4025(of)S (input)248 4156 A 4434(text.)S 3486 V 12 I 936(Awk)S 12 R 1180(also)S 1411(provides)S 1864(some)S 2156(useful)S (built-in)357 2489 A 2883(functions)S 3370(for)S 3549(string)S 3862(manipulation)S 4537(and)S 4748(print-)S 3624 V 936(ing:)S 3831 V 1116(print\(arg\))S 2016(Simple)S 2389(printing)S 2802(of)S 2933(strings)S 3286(only,)S 3560(terminated)S 4109(by)S 4259('\\n'.)S 3969 V (printf\(arg...\))597 1116 A 2016(Exactly)S 2416(the)S (printf\(\))352 2594 A 2976(function)S 3409(from)S 3675(C.)S 4107 V (getline\(\))412 1116 A 2016(Reads)S 2341(the)S 2519(next)S 2757(record)S 3097(and)S 3301(returns)S 3668(0)S 3758(on)S 3908(end)S 4112(of)S 4243(\256le.)S 4245 V 1116(next\256le\(\))S 2016(Closes)S 2385(the)S 2580(current)S (input)248 2971 A 3266(\256le)S 3468(and)S 3689(begins)S 4051(processing)S 4615(the)S 4810(next)S 4383 V 2016(\256le)S 4521 V 1116(strlen\(s\))S 2016(Returns)S 2422(the)S 2600(length)S 2932(of)S 3063(its)S 3208(string)S 3514(argument.)S 4659 V 1116(strcpy\(s,t\))S 2016(Copies)S 2381(the)S 2559(string)S 2865(`)S 2896(`t')S 3002(')S 3073(to)S 3197(the)S 3375(string)S 3681(`)S 3712(`s')S 3831('.)S 4797 V 1116(strcmp\(s,t\))S 2016(Compares)S 2536(the)S 2714(`)S 2745(`s')S 2864(')S 2935(to)S 3059(`)S 3090(`t')S 3196(')S 3267(and)S 3471(returns)S 3838(0)S 3928(if)S 4033(they)S 4271(match.)S 4935 V (toupper\(c\))505 1116 A 2016(Returns)S 2422(its)S 2567(character)S 3043(argument)S (converted)477 3530 A 4037(to)S (upper-case.)555 4161 A 5073 V 1116(tolower\(c\))S 2016(Returns)S 2422(its)S 2567(character)S 3043(argument)S (converted)477 3530 A 4037(to)S 4161(lower-case.)S 5211 V 1116(match\(s,@re@\))S 2016(Compares)S 2548(the)S 2738(string)S 3056(`)S 3087(`s')S 3206(')S 3289(to)S 3425(the)S 3615(regular)S 4002(expression)S 4562(`)S 4593(`re')S 4760(')S 4844(and)S 5349 V 2016(returns)S 2383(the)S 2561(number)S 2960(of)S 3091(matches)S (found)281 3518 A 3829(\(zero)S 4109(if)S (none\).)305 4214 A 5625 V 12 B 936(Authors)S 5937 V 12 I 1116(Awk)S 12 R 1354(was)S (written)345 1573 A 1948(by)S 2098(Saeko)S 2423(Hirabauashi)S 3039(and)S 3243(Kouichi)S 3663(Hirabayashi.)S 8427 V EP %%Trailer %%DocumentFonts: Times-Roman Times-Bold Times-Italic Helvetica %%Pages: 4