awk [-f progfile | 'prog'] [-Ffieldsep] [-v var=value] [file . . .]
awk ñ╧íóÑ╤Ñ┐í╝Ñ≤ÑóÑ»Ñ╖ÑτÑ≤╩╕ñ╚├φ╝ßñ╦ñóñδ╩Σ╜⌡Ñ│í╝Ñ╔Ñ╗Ñ├Ñ╚╩╕╗·ñ≥╜Φ═²ñ╖íó╩Σ╜⌡Ñ│í╝Ñ╔Ñ╗Ñ├Ñ╚╩╕╗·ñ≥┤─╢¡╩╤┐⌠ LC_CTYPE ñ╦╗╪─Ωñ╡ñ∞ñ┐ÑφÑ▒í╝Ñδñ╦┤≡ñ┼ñññ╞íóÑ╒Ñúí╝ÑδÑ╔╩¼╬Ñ╡¡╣µñ╚ñ╖ñ╞╟º╝▒ñ╖ñ▐ñ╣(environ(5) ñ╬ LANG ╗▓╛╚)íúgrep(1) ñ╟└Γ╠└ñ╖ñ┐ñΦñªñ╦íó└╡╡¼╔╜╕╜ñ╟ñ╧Ñ╤Ñ┐í╝Ñ≤╕í║≈ñ¼Ñ╨ÑñÑ╚ñ╟ñ╧ñ╩ñ»íó╩╕╗·ñ╦┬╨ñ╖ñ╞╝┬╣╘ñ╡ñ∞ñ▐ñ╣íú
│╞╣╘ñ╚ñ╣ñ┘ñ╞ñ╬Ñ╤Ñ┐í╝Ñ≤ÑóÑ»Ñ╖ÑτÑ≤╩╕ñ╬Ñ╤Ñ┐í╝Ñ≤╔⌠ñ¼╚µ│╙ñ╡ñ∞ñ▐ñ╣íú░∞├╫ñ╖ñ┐Ñ╤Ñ┐í╝Ñ≤ñ┤ñ╚ñ╦íó┬╨▒■ñ╣ñδÑóÑ»Ñ╖ÑτÑ≤ñ¼╝┬╣╘ñ╡ñ∞ñ▐ñ╣íúvar=value ñ╬╖┴╝░ñ╬ file ñ╧íóÑ╒ÑíÑñÑδ╠╛ñ╟ñ╧ñ╩ñ»┬σ╞■╝░ñ╚ñ╖ñ╞░╖ñ∩ñ∞íóÑ╒ÑíÑñÑδ╠╛ñ╟ñóñ∞ñ╨Ѭí╝Ñ╫Ñ≤ñ╡ñ∞ñ┐╗■┼└ñ╟╝┬╣╘ñ╡ñ∞ñ▐ñ╣íúvar=value ñ╬┴░ñ╬ -v ѬÑ╫Ñ╖ÑτÑ≤ñ╧íóprog ñ¼╝┬╣╘ñ╡ñ∞ñδ┴░ñ╦╣╘ñ∩ñ∞ñδ┬σ╞■ñ╟ñ╣íú-v ѬÑ╫Ñ╖ÑτÑ≤ñ╧ñññ»ñ─ñ╟ñΓ╗╪─Ωñ╟ñ¡ñ▐ñ╣íú
╞■╬╧╣╘ñ╧íó╢⌡╟≥Ñ╣Ñ┌í╝Ñ╣ñ╟╢Φ└┌ñΘñ∞ñ┐Ñ╒Ñúí╝ÑδÑ╔ñ½ñΘ╣╜└«ñ╡ñ∞ñ▐ñ╣íú(ñ│ñ∞ñ¼╛╩╬¼╗■ñ╬▓≥╝ßñ╟ñ╣ñ¼íó▓╝╡¡ñ╦╝¿ñ╣ñΦñªñ╦ FS ñ▐ñ┐ñ╧ -Ffieldsep ѬÑ╫Ñ╖ÑτÑ≤ñ≥╗╚═╤ñ╖ñ╞╩╤╣╣ñ╟ñ¡ñ▐ñ╣íú) Ñ╒Ñúí╝ÑδÑ╔ñ╧ $1íó$2íó... ñ╚╔╜ñ╖íó$0 ñ╧╣╘┴┤┬╬ñ≥░╒╠úñ╖ñ▐ñ╣íú
Ñ╤Ñ┐í╝Ñ≤ÑóÑ»Ñ╖ÑτÑ≤╩╕ñ╬╖┴╝░ñ╧▓╝╡¡ñ╬ñ╚ñ¬ñΩñ╟ñ╣íú
pattern { action }
Ñ╤Ñ┐í╝Ñ≤ñóñδñññ╧ÑóÑ»Ñ╖ÑτÑ≤ñ╬ñ╔ñ┴ñΘñ½ñ¼╛╩╬¼ñ╟ñ¡ñ▐ñ╣íúÑóÑ»Ñ╖ÑτÑ≤ñ≥╛╩╬¼ñ╣ñδñ╚íó░∞├╫ñ╣ñδ╣╘ñ¼╜╨╬╧ñ╡ñ∞ñ▐ñ╣íúÑ╤Ñ┐í╝Ñ≤ñ≥╛╩╬¼ñ╣ñδñ╚íóñ╜ñ╬ÑóÑ»Ñ╖ÑτÑ≤ñ¼│╞╞■╬╧╣╘ñ╟╝┬╣╘ñ╡ñ∞ñ▐ñ╣íúÑ╤Ñ┐í╝Ñ≤-ÑóÑ»Ñ╖ÑτÑ≤╩╕ñ╧íó╔ⁿ╡ó▓■╣╘ñóñδñññ╧Ñ╗Ñ▀Ñ│ÑφÑ≤ñ╟╢Φ└┌ñΘñ∞ñ▐ñ╣íú
┴░╜╥ñ╬ñΦñªñ╦íóÑ╤Ñ┐í╝Ñ≤ñ╧│╚─Ñ└╡╡¼╔╜╕╜ñ╚┤╪╖╕╝░ñ≥╟ñ░╒ñ╦╧└═²╖δ╣τ(``!''íó``||''íó&& ñ¬ñΦñ╙│τ╕╠)ñ╖ñ┐ñΓñ╬ñ╟ñ╣íú┤╪╖╕╝░ñ╧íó▓╝╡¡ñ╬ñªñ┴ñ╬ñññ║ñ∞ñ½ñ╟ñ╣íú
expression relop expression expression matchop regular_expression expression in array-name (expression,expression, ... ) in array-name
ñ│ñ│ñ╟íórelop ñ╧ C ╕└╕∞ñ╬ 6 ñ─ñ╬┤╪╖╕▒Θ╗╗╗╥ñ╬ 1 ñ─ñ╟ñóñΩíómatchop ñ╧``~''(┤▐ñαñ╚ñ¡)ñ▐ñ┐ñ╧``!~''(┤▐ñ▐ñ╩ñññ╚ñ¡)ñ╬ñññ║ñ∞ñ½ñ╟ñ╣íúexpression ñ╧╗╗╜╤╝░íó┤╪╖╕╝░íó╞├╩╠╝░
var in array
ñ▐ñ┐ñ╧ñ│ñ∞ñΘñ≥╧└═²╖δ╣τñ╖ñ┐ñΓñ╬ñ╟ñ╣íú
│╚─Ñ└╡╡¼╔╜╕╜ñ╧Ñ╣ÑΘÑ├Ñ╖Ñσñ╟░╧ñ▐ñ╩ñ▒ñ∞ñ╨ñ╩ñΩñ▐ñ╗ñ≤íúÑ╤Ñ┐í╝Ñ≤╞Γñ╬╞╚╬⌐ñ╖ñ┐└╡╡¼╔╜╕╜ñ╧╣╘┴┤┬╬ñ╦┼¼═╤ñ╡ñ∞ñ▐ñ╣íú│╚─Ñ└╡╡¼╔╜╕╜ñ≥┤╪╖╕╝░ñ╦╞■ñ∞ñδñ│ñ╚ñΓñ╟ñ¡ñ▐ñ╣íúÑ╤Ñ┐í╝Ñ≤ñ╧íó2 ñ─ñ╬Ñ╤Ñ┐í╝Ñ≤ñ≥Ñ│Ñ▐Ñ≤Ñ╔ñ╟╢Φ└┌ñ├ñ╞╡¡╜╥ñ╣ñδñ│ñ╚ñΓñ╟ñ¡ñ▐ñ╣íúñ│ñ╬╛∞╣τíóÑóÑ»Ñ╖ÑτÑ≤ñ╧║╟╜Θñ╬Ñ╤Ñ┐í╝Ñ≤ñ╚╝íñ╬Ñ╤Ñ┐í╝Ñ≤ñ╬┤╓ñ╬ñ╣ñ┘ñ╞ñ╬╣╘ñ╟╝┬╣╘ñ╡ñ∞ñ▐ñ╣íú
╞├╝∞Ñ╤Ñ┐í╝Ñ≤ñ╬ BEGIN ñ╚ END ñ≥╗╚═╤ñ╖ñ╞íó║╟╜Θñ╬╞■╬╧╣╘ñ¼╞╔ñ▀╣■ñ▐ñ∞ñδ┴░ñ╚║╟╕σñ╬╞■╬╧╣╘ñ¼╞╔ñ▀╣■ñ▐ñ∞ñ┐╕σñ╟└⌐╕µñ╟ñ¡ñ▐ñ╣íúñ│ñ∞ñΘñ╬Ñ¡í╝Ñ∩í╝Ñ╔ñ╧┬╛ñ╬Ñ╤Ñ┐í╝Ñ≤ñ╚ñ╧┴╚╣τñ╗ñ╟ñ¡ñ▐ñ╗ñ≤íú
│╚─Ñ└╡╡¼╔╜╕╜ñ╧íó-F fieldsep ѬÑ╫Ñ╖ÑτÑ≤ñ≥╗╚═╤ñ╣ñδñ½íóñ▐ñ┐ñ╧╔╜╕╜ñ≥┴╚ñ▀╣■ñ▀╩╤┐⌠ FS ñ╦│ΣñΩ┼÷ñ╞ñδñ│ñ╚ñ╦ñΦñΩíóÑ╒Ñúí╝ÑδÑ╔ñ≥╢Φ└┌ñδñ╬ñ╦╗╚═╤ñ╟ñ¡ñ▐ñ╣íú╛╩╬¼├═ñ╟ñ╧└Φ╞¼ñ╬╢⌡╟≥ñ╧╠╡╗δñ╡ñ∞íóÑ╒Ñúí╝ÑδÑ╔ñ╧╢⌡╟≥ñ¬ñΦñ╙(ñ▐ñ┐ñ╧)Ñ┐Ñ╓ñ╦ñΦñΩ╢Φ└┌ñΘñ∞ñ▐ñ╣íúñ┐ñ└ñ╖ FS ñ╦├═ñ¼│ΣñΩ┼÷ñ╞ñΘñ∞ñ╞ñññδ╛∞╣τñ╧íó└Φ╞¼ñ╬╢⌡╟≥ñ╧╠╡╗δñ╡ñ∞ñ▐ñ╗ñ≤íú
┬╛ñ╬┴╚ñ▀╣■ñ▀╩╤┐⌠ñ≥íó╝íñ╦╝¿ñ╖ñ▐ñ╣íú
└░┐⌠ñ╬├═ñ╚└╡│╬ñ╦┼∙ñ╖ññ┐⌠├═ñ╧íósprintf ┴╚ñ▀╣■ñ▀┤╪┐⌠ñ╬ fmt Ñ╤ÑΘÑßí╝Ñ┐ñ╦╩╕╗·╬≤ %d ñ≥╗╪─Ωñ╖ñ┐╕╞ñ╙╜╨ñ╖ñ╦┴Ω┼÷ñ╣ñδ╩╕╗·╬≤ñ╚íó░∞╚╓╠▄ñ╟═ú░∞ñ╬ expr Ñ╤ÑΘÑßí╝Ñ┐ñ╚ñ╖ñ╞╩╤┤╣ñ╡ñ∞ñδ┐⌠├═ñ╦╩╤┤╣ñ╡ñ∞ñ▐ñ╣íúñ│ñ∞░╩│░ñ╬┐⌠├═ñ╧íósprintf ┴╚ñ▀╣■ñ▀┤╪┐⌠ñ╬ fmt Ñ╤ÑΘÑßí╝Ñ┐ñ╦╩╤┐⌠ CONVFMT ñ≥╗╪─Ωñ╖ñ┐╕╞ñ╙╜╨ñ╖ñ╦┴Ω┼÷ñ╣ñδ╩╕╗·╬≤ñ╚íó░∞╚╓╠▄ñ╟═ú░∞ñ╬ expr Ñ╤ÑΘÑßí╝Ñ┐ñ╚ñ╖ñ╞╩╤┤╣ñ╡ñ∞ñδ┐⌠├═ñ╦╩╤┤╣ñ╡ñ∞ñ▐ñ╣íú
-F ѬÑ╫Ñ╖ÑτÑ≤íóñ▐ñ┐ñ╧ OFSíóORS ñ¬ñΦñ╙ FS ╩╤┐⌠ñ╟╗╪─Ωñ╖ñ┐Ñ╒Ñúí╝ÑδÑ╔╩¼╬Ñ╡¡╣µñ╧íó╩Σ╜⌡Ñ│í╝Ñ╔Ñ╗Ñ├Ñ╚ñ╬╩╕╗·ñ╟ñΓñ½ñ▐ñññ▐ñ╗ñ≤íú
ÑóÑ»Ñ╖ÑτÑ≤ñ╧╩╕ñ≥╩┬ñ┘ñ┐ñΓñ╬ñ╟ñ╣íú╩╕ñ╧╝íñ╬ñññ║ñ∞ñ½ñ╟ñ╣íú
if (expression) statement [else statement] while (expression) statement do statement while (expression) for (expression ; expression ; expression) statement for (var in array) statement delete array[subscript] #delete an array element break continue { [statement] ... } expression # commonly variable = expression print [expression-list] [>expression] printf format [, expression-list] [>expression] next # skip remaining patterns on this input line exit [expr] # skip the rest of the input; exit status is expr return [expr]
╩╕ñ╧Ñ╗Ñ▀Ñ│ÑφÑ≤íó╔ⁿ╡ó▓■╣╘íóñ▐ñ┐ñ╧▒ª│τ╕╠ñ╟╜¬╬╗ñ╖ñ▐ñ╣íú╢⌡ñ╬╝░ÑΩÑ╣Ñ╚ñ╧╣╘┴┤┬╬ñ≥░╒╠úñ╖ñ▐ñ╣íú╝░ñ╦ñ╧╩╕╗·╬≤ñΣ┐⌠├═ñ¼┼¼╡╣┴╚ñ▀╣■ñ▐ñ∞ñ╞ñ¬ñΩíó▒Θ╗╗╗╥ñ╬``+''íó``-''íó``''íó``/''íó``%''íó``^''ñ¬ñΦñ╙╧ó╖δ╡¡╣µ(Ñ╓ÑΘÑ≤Ñ»ñ╟╝¿ñ╣)ñ≥╗╚═╤ñ╖ñ╞║ε└«ñ╡ñ∞ñ▐ñ╣íú╝░ñ╦ñ╧ C ñ╬▒Θ╗╗╗╥ñ╟ñóñδ``++''íó``--''íó``+=''íó``-=''íó``=''íó``/=''íó``%=''íó``^= >''íó``>=''íó``<''íó``<=''íó``==''íó``!=''íó``?:''ñΓ╗╚═╤ñ╟ñ¡ñ▐ñ╣íú╩╤┐⌠ñ╚ñ╖ñ╞ñ╧íóÑ╣ѽÑΘíó╟█╬≤═╫┴╟ (x[i] ñ╟╝¿ñ╣)íóñ▐ñ┐ñ╧Ñ╒Ñúí╝ÑδÑ╔ñ¼▓─╟╜ñ╟ñ╣íú╩╤┐⌠ñ╦ñ╧Ñ╠Ñδ╩╕╗·╬≤ñ¼╜Θ┤ⁿ└▀─Ωñ╡ñ∞ñ▐ñ╣íú╟█╬≤ñ╬Ñ╡Ñ╓Ñ╣Ñ»ÑΩÑ╫Ñ╚ñ╧╔¼ñ║ñ╖ñΓ┐⌠├═ñ╟ñ╩ñ»ñ╞ñΓñΦñ»íó╟ñ░╒ñ╬╩╕╗·╬≤ñ╟ñΓñ½ñ▐ñññ▐ñ╗ñ≤íúñ│ñ╬ñ┐ñßíó╧ó┴█╡¡▓▒ñ╬╖┴╝░ñ¼▓─╟╜ñ╟ñ╣íú[i, j, k] ñ╬ñΦñªñ╩╩ú┐⌠ñ╬Ñ╡Ñ╓Ñ╣Ñ»ÑΩÑ╫Ñ╚ñΓ▓─╟╜ñ╟ñ╣íú═╫┴╟ñ╧íóSUBSEP ñ╬├═ñ╦ñΦñΩ╧ó╖δñóñδñññ╧╢Φ└┌ñΘñ∞ñ▐ñ╣íú╩╕╗·╬≤─Ω┐⌠ñ╧░·═╤╔Σ(``""'')ñ╟░╧ñ▀ñ▐ñ╣íúñ│ñ╬ñ╚ñ¡╔ß─╠ñ╬ C ñ╬Ñ¿Ñ╣Ñ▒í╝Ñ╫ñ¼╟º╝▒ñ╡ñ∞ñ▐ñ╣íú
print ╩╕ñ╧íó░·ñ¡┐⌠ñ≥╕╜║▀ñ╬╜╨╬╧Ñ╒Ñúí╝ÑδÑ╔╩¼╬Ñ╡¡╣µñ╟╢Φ└┌ñΩíó╜╨╬╧Ñ∞Ñ│í╝Ñ╔╩¼╬Ñ╡¡╣µñ≥║╟╕σñ╦ñ─ñ▒ñ╞íó╔╕╜α╜╨╬╧ñ╦(>expression ñ¼ñóñδ╛∞╣τñ╧Ñ╒ÑíÑñÑδñ╦íó| cmd ñ¼ñóñδ╛∞╣τñ╧Ñ╤ÑñÑ╫ñ╦)╜╨╬╧ñ╖ñ▐ñ╣íúprintf ╩╕ñ╧íó╖┴╝░(fprintf(3S) ╗▓╛╚)ñ╦┤≡ñ┼ñññ╞╝░ÑΩÑ╣Ñ╚ñ≥Ñ╒Ñ⌐í╝Ñ▐Ñ├Ñ╚ñ╖ñ▐ñ╣íú┴╚╣■ñ▀┤╪┐⌠ close (expr) ñ╧íóÑ╒ÑíÑñÑδñ▐ñ┐ñ╧ expr Ñ╤ÑñÑ╫ñ≥Ñ»Ñφí╝Ñ║ñ╖ñ▐ñ╣íú
┐⌠│╪┤╪┐⌠ atan2íócosíóexpíólogíósiníósqrt ñ╧íó┴╚╣■ñ▀┤╪┐⌠ñ╟ñ╣íú
┬╛ñ╬┴╚ñ▀╣■ñ▀┤╪┐⌠ñ≥╝íñ╦╝¿ñ╖ñ▐ñ╣íú
╞■╜╨╬╧┴╚ñ▀╣■ñ▀┤╪┐⌠ñ╦ñ╧íó░╩▓╝ñ╬ñΓñ╬ñ¼ñóñΩñ▐ñ╣íú
┴┤ñ╞ñ╬╖┴╝░ñ╬ getline ñ╧íó└╡╛∩╞■╬╧ñ╦ñ╧ 1íóÑ╒ÑíÑñÑδ╜¬├╝ñ╟ñ╧ 0íóÑ¿ÑΘí╝ñ╬╛∞╣τñ╧ -1 ñ≥╩╓ñ╖ñ▐ñ╣íú
awk ñ╧ñ▐ñ┐ѵí╝Ñ╢ñ¼─Ω╡┴▓─╟╜ñ╩┤╪┐⌠ñΓ─≤╢íñ╖ñ▐ñ╣íú┤╪┐⌠ñ╧╝íñ╬ñΦñªñ╦(Ñ╤Ñ┐í╝Ñ≤-ÑóÑ»Ñ╖ÑτÑ≤Ñ╣Ñ╞í╝Ñ╚ÑßÑ≤Ñ╚ñ╬Ñ╤Ñ┐í╝Ñ≤╔⌠ñ╟)─Ω╡┴ñ╡ñ∞ñ▐ñ╣íú
function name(args,...) { stmts }ñ▐ñ┐ñ╧
func name(args,...) { stmts }┤╪┐⌠ñ╬░·ñ¡┐⌠ñ╧íóÑ╣ѽÑΘí╝ñ╟ñóñ∞ñ╨├═ñ╟íó╗▓╛╚ñ╟ñóñ∞ñ╨╟█╬≤╠╛ñ╟┼╧ñ╡ñ∞ñ▐ñ╣íú░·ñ¡┐⌠╠╛ñ╧┤╪┐⌠ñ╦┬╨ñ╖ñ╞Ñφí╝ѽÑδñ╟ñ╣íú┬╛ñ╬┴┤ñ╞ñ╬╩╤┐⌠╠╛ñ╧Ñ░Ñφí╝Ñ╨Ñδñ╟ñ╣íú┤╪┐⌠ñ╧Ñ═Ñ╣Ñ╚ñ╖ñ╞╕╞ñ╙╜╨ñ╗íó║╞╡ó▓─╟╜ñ╟ñ╣íú├═ñ≥╩╓ñ╣ñ╦ñ╧ return Ñ╣Ñ╞í╝Ñ╚ÑßÑ≤Ñ╚ñ≥╗╚═╤ñ╖ñ▐ñ╣íú
length > 72
║╟╜Θñ╬ 2 ñ─ñ╬Ñ╒Ñúí╝ÑδÑ╔ñ≥╡╒╜τñ╦Ñ╫ÑΩÑ≤Ñ╚ñ╖ñ▐ñ╣íú
{ print $2, $1 }
Ñ│Ñ≤Ñ▐ñ╚Ñ╓ÑΘÑ≤Ñ»ñ╬ñ╔ñ┴ñΘñ½ñ▐ñ┐ñ╧╬╛╩²ñ╚íóÑ┐Ñ╓ñ╟╩¼ñ▒ñΘñ∞ñδ╞■╬╧Ñ╒Ñúí╝ÑδÑ╔ñ╚╞▒ñ╕íú
BEGIN { FS = ",[ \t]*|[ \t]+" } { print $2, $1 }
║╟╜Θñ╬ѽÑΘÑαñ≥▓├╗╗ñ╖íó╣τ╖╫ñ╚╩┐╢╤ñ≥Ñ╫ÑΩÑ≤Ñ╚ñ╖ñ▐ñ╣íú
{ s += $1 } END { print "sum is", s, " average is", s/NR }
Ñ╒Ñúí╝ÑδÑ╔ñ≥╡╒╜τñ╦Ñ╫ÑΩÑ≤Ñ╚ñ╖ñ▐ñ╣íú
{ for (i = NF; i > 0; --i) print $i }
start ñ╚ stop ñ╬┤╓ñ╬ñ╣ñ┘ñ╞ñ╬╣╘ñ≥Ñ╫ÑΩÑ≤Ñ╚ñ╖ñ▐ñ╣íú
/start/, /stop/
║╟╜Θñ╬Ñ╒Ñúí╝ÑδÑ╔ñ¼┴░ñ╬╣╘ñ╬ñΓñ╬ñ╚░█ñ╩ñδñ╣ñ┘ñ╞ñ╬╣╘ñ≥Ñ╫ÑΩÑ≤Ñ╚ñ╖ñ▐ñ╣íú
$1 != prev { print; prev = $1 }
echo(1) ñ╬Ñ╖Ñ▀ÑσÑ∞í╝Ñ╚
BEGIN { for (i = 1; i < ARGC; i++) printf "%s", ARGV[i] printf "\n" exit }
5 ░╩╣▀ñ╬Ñ┌í╝Ñ╕╚╓╣µñ≥╡¡╞■ñ╖ñ╞Ñ╒ÑíÑñÑδñ≥Ñ╫ÑΩÑ≤Ñ╚ñ╖ñ▐ñ╣íú
/Page/ { $2 = n++; } { print }
Ñ╫ÑφÑ░ÑΘÑαñ¼ prog ñ╚╕└ñª╠╛┴░ñ╬Ñ╒ÑíÑñÑδñ╦ñóñδñ╚ñ╣ñδñ╚íó╝íñ╬Ñ│Ñ▐Ñ≤Ñ╔ÑΘÑñÑ≤ñ╧Ñ╒ÑíÑñÑδ input ñ≥ 5 ñ½ñΘ╗╧ñ▐ñδÑ┌í╝Ñ╕╚╓╣µñ≥ñ─ñ▒ñ╞Ñ╫ÑΩÑ≤Ñ╚ñ╖ñ▐ñ╣íú
awk -f prog n=5 input.
A. V. Aho, B. W. Kernighan, P. J. Weinberger, The awk Programming Language Addison-Wesley, 1988
╞■╬╧ñ╬╢⌡╟≥Ñ╣Ñ┌í╝Ñ╣ñ╧íóÑ╒Ñúí╝ÑδÑ╔ñ¼┤╪╖╕ñ╣ñδ╛∞╣τñ╦ñ╧╜╨╬╧ñ╡ñ∞ñ▐ñ╗ñ≤íú
┐⌠├═ñ╚╩╕╗·╬≤ñ╬┤╓ñ╟ñ╧íó╠└╝¿┼¬ñ╩╖┐╩╤┤╣ñ╧ñóñΩñ▐ñ╗ñ≤íú╝░ñ≥┐⌠├═ñ╚ñ╖ñ╞░╖ñªñ┐ñßñ╦ñ╧íó╝░ñ╦ 0 ñ≥▓├╗╗ñ╖ñ▐ñ╣íú╝░ñ≥╩╕╗·╬≤ñ╚ñ╖ñ╞░╖ñªñ┐ñßñ╦ñ╧íóÑ╠Ñδ╩╕╗·╬≤("")ñ≥╧ó╖δñ╖ñ▐ñ╣íú