gawk

GAWK(1)                        Utility Commands                        GAWK(1)



å称
       gawk - ãã¿ã¼ã³æ¤ç´¢ã»å¦çè¨èª

æ¸å¼
       awk [ POSIX or GNU style options ] -f program-file [ -- ] file ...
       gawk [ POSIX or GNU style options ] [ -- ] program-text file ...

解説
       gawk 㯠GNU ããã¸ã§ã¯ããå®è£ãã ããã°ã©ãã³ã°è¨èª AWK ã®å¦çç³»ã§ãã
       æ¬å¦ç系㯠POSIX 1003.2 ã³ãã³ãè¨èªã¨ã¦ã¼ãã£ãªãã£è¦ç´ã«å®ãããã
       è¨èªã®å®ç¾©ã«é©åãã¦ãã¾ãã æ¬ãã¼ã¸ã§ã³ã¯ã¾ããAho, Kernighan, Weinberger
       ã®èæ¸ The AWK Programming Language ã®è¨è¿°ã«ãã¨ã¥ãã¦ããã System V
       Release 4 UNIX ã® awk ã®ä»å æ©è½ãå«ãã§ãã¾ãã gawk ã¯ã¾ããBell Labs
       ã®æ°æ©è½ããã³ GNU ç¬èªã®æ¡å¼µãæä¾ãã¾ãã

       ã³ãã³ãã©ã¤ã³ã¯ã gawk ã¸ã®ãªãã·ã§ã³ã(ãã -f ã¾ã㯠--file
       ãªãã·ã§ã³ã«ããæå®ããã¦ããªããã°)AWK ã®ããã°ã©ã ããã¹ããããã¦
       æ®ãã®å¼æ°åãããªãã¾ãã ãã®æ®ãã®å¼æ°åã¯ãå®ç¾©æ¸ã¿ AWK å¤æ° ARGC, ARGV
       ãç¨ãããã¨ã§åç§ã§ãã¾ãã

ãªãã·ã§ã³ãã©ã¼ããã
       gawk ã¸ã®ãªãã·ã§ã³ã¯ãä¼çµ±ç㪠POSIX å½¢å¼ã® 1 æåãªãã·ã§ã³ã¨ãGNU å½¢å¼ã®
       ãã³ã°ãªãã·ã§ã³ãããã¾ãã POSIX å½¢å¼ã®ãªãã·ã§ã³ã¯åä¸ã® “-” ã§å§ã¾ããä¸æ¹
       GNU å½¢å¼ã®ã㮠㯠“--” ã§å§ã¾ãã¾ãããã³ã°ãªãã·ã§ã³ã¯ GNU ã®ç¬èªä»æ§ã¨
       POSIX ã®å¿é ä»æ§ã®ä¸¡æ¹ã«ã¤ãã¦ç¨æããã¦ãã¾ãã

       POSIX æ¨æºã«å¾ãã gawk ç¬èªä»æ§ã®ãªãã·ã§ã³ã¯ -W
       ãªãã·ã§ã³ã¸ã®å¼æ°ã§ä¸ãã¾ãã è¤æ°ã® -W ãªãã·ã§ã³ãæå®ãããã¨ãã§ãã¾ãã å¾è¿°ã®
       ããã«ãå -W ãªãã·ã§ã³ã«ã¯ãããã«å¯¾å¿ãããã³ã°ãªãã·ã§ã³ ãåå¨ãã¾ããã‐
       ã³ã°ãªãã·ã§ã³ã¸ã®å¼æ°ã¯ã空ç½ãå¥ããã« =
       ã§ã¤ãªãã§æå®ãããããã®æ¬¡ã®ã³ãã³ãã©ã¤ã³å¼æ°ã¨ãã¦æ¸¡ããã¨ãã§ãã¾ãã ã‐
       ã³ã°ãªãã·ã§ã³ã¯ãç縮形ãä¸æã§ããéããç縮ãããã¨ãã§ãã¾ãã

ãªãã·ã§ã³
       gawk ã¯ä»¥ä¸ã®ãªãã·ã§ã³ãåãä»ãã¾ãã

       -F fs
       --field-separator fs
              å¥åãã£ã¼ã«ãã»ãã¬ã¼ã¿ (å¤æ° FS ã®å¤)ã fs ã¨ãã¾ãã

       -v var=val
       --assign var=val
              ããã°ã©ã ãå®è¡ããåã«ãå¤æ° var ã«å¤ val ãè¨å®ãã¾ãããã®ããã«ãã¦è¨å®
              ããå¤æ°ã¯ã AWK ããã°ã©ã ã® BEGIN ãããã¯åã§ãåç§ã§ãã¾ãã

       -f program-file
       --file program-file
              awk ã¸ã®ç¬¬ 1 å¼æ°ãç¨ãããããã«ãAWK ããã°ã©ã ããã¡ã¤ã« program-file
              ããèªã¿è¾¼ã¿ã¾ãã -f (ã¾ã㯠--file ) ãªãã·ã§ã³ã¯è¤æ°å使
              ç¨ãããã¨ãã§ãã¾ãã

       -mf NNN
       -mr NNN
              ãã¾ãã¾ãªã¡ã¢ãªã®å¶éå¤ã NNN ã«è¨å®ãã¾ãããã©ã° f
              ã¯æ大ãã£ã¼ã«ãæ°ããã©ã° r ã¯æ大ã¬ã³ã¼ããµã¤ãºãè¨å®ãã¾ãããã® 2
              ã¤ã®ãã©ã°ã¨ -m ãªãã·ã§ã³ã¯ãBell Labs ãã¼ã¸ã§ã³ã® UNIX awk
              ã«ç±æ¥ãã¦ãã¾ãããããã gawk ã«ã¯ãã®ãããªå¶éã¯ããã¾ããã®ã§ã gawk
              ã§ã¯æ¬ãªãã·ã§ã³ã¯ç¡è¦ããã¾ãã

       -W traditional
       -W compat
       --traditional
       --compat
              äºæ ã¢ã¼ãã§åä½ãã¾ããäºæã¢ã¼ãã§ã¯ã gawk 㯠UNIX awk ã¨ç‐
              価ãªåä½ãè¡ããGNU ç¬èªæ¡å¼µã¯è§£éã§ãã¾ããã
              ãã®ãªãã·ã§ã³ã®ä»ã®å½¢å¼ãããã --traditional ã使ç¨ãããã¨ã好ã¾ãã¾ãã
              詳ããã¯å¾è¿°ã® GNU æ¡å¼µ ãåç§ãã¦ãã ããã

       -W copyleft
       -W copyright
       --copyleft
       --copyright
              GNU ã®èä½æ¨©è¡¨ç¤ºã®çããã¼ã¸ã§ã³ãæ¨æºåºåã¸æ¸ãåºãã
              æåç¶æã§çµäºãã¾ãã

       -W help
       -W usage
       --help
       --usage
              çãã®ãªãã·ã§ã³ä¸è¦§ãæ¨æºåºåã¸æ¸ãåºãã¾ãã ( GNU ã³ã¼ãã£ã³ã°è¦ç´
              ã«å¾ããæ¬ãªãã·ã§ã³ãæå®ãã㨠awk
              ã¯ãã ã¡ã«çµäºããæåãæå³ããçµäºã¹ãã¼ã¿ã¹ãè¿ãã¾ãã)

       -W lint

       --lint ä»ã® AWK ã§ã®å¦çãçãããããããã¯ä»ã® AWK ã¨ã®äºææ§ããªãæ§é ã
              ããå ´åã«è¦åãè¡ãã¾ãã
       -W lint-old
       --lint-old
              ãªãªã¸ãã«ã® Unix awk ã¸ç§»æ¤ã§ããªãæ§é ã«é¢ãã¦è¦åãè¡ãã¾ãã

       -W posix
       --posix
              äºæ ã¢ã¼ãããªã³ã«ããæ´ã«ä»¥ä¸ã®å¶ç´ã課ãããã¾ãã

              · \x ã¨ã¹ã±ã¼ãã·ã¼ã±ã³ã¹ã解éãã¾ããã

              · FS ãåä¸ã®ç©ºç½ã«è¨å®ãããå ´åã空ç½ã¨ã¿ãã®ã¿ããã£ã¼ã«ããåºåãã
                æ¹è¡ã¯ãã£ã¼ã«ããåºåãã¾ããã

              · ãã¼ã¯ã¼ã function ã«å¯¾å¿ããå¥å func ã解éãã¾ããã

              · æ¼ç®å ^ ã ^= ã®ãããã« ** ã **= ãç¨ãããã¨ãã§ãã¾ããã

              · fflush() é¢æ°ã¯å©ç¨ã§ãã¾ããã

       -W re-interval
       --re-interval
              æ£è¦è¡¨ç¾ã®ãããã³ã°ã§ ã¤ã³ã¿ã¼ãã«è¡¨ç¾ (interval expressions)
              ãæå¹ã«ãã¾ã (å¾è¿°ã® æ£è¦è¡¨ç¾ ãåç§ãã¦ãã ãã)ã
              ã¤ã³ã¿ã¼ãã«è¡¨ç¾ã¯ä¼çµ±ç㪠AWK è¨èªã§ã¯å©ç¨ã§ãã¾ããã§ããã awk ã¨
              egrep ãä¸è²«æ§ãæã¤ããã«ãPOSIX æ¨æºããããã追å ãã¾ããã
              ãããããããã使ç¨ããã¨å¤ã AWK ããã°ã©ã ãåããªããã¦ãã¾ãã§ãããããã
              ãã®ãªãã·ã§ã³ã«ãã£ã¦è¦æ±ãããã¨ãã¨ã --posix ãæå®ãããã¨ãã«ã gawk
              ã¯ãããã®æ©è½ãæä¾ãã¾ãã

       -W source program-text
       --source program-text
              program-text ã AWK ãã‐
              ã°ã©ã ã¨ãã¦ç¨ãã¾ããæ¬ãªãã·ã§ã³ã«ãããã©ã¤ãã©ãªåãããé¢æ° ( -f ã¾ãã¯
              --file ãªãã·ã§ã³ãç¨ãã¦èªã¿è¾¼ã) ã¨ã³ãã³ãã©ã¤ã³ããå¥åãããããã°ã©ã ã
              ç°¡åã«åæãããã¨ãã§ãã¾ãã ããã¯ã主ã«ã·ã§ã«ã¹ã¯ãªããã§ç¨ããããä¸‐
              è¦æ¨¡ãã大è¦æ¨¡ãª AWK ããã°ã©ã  ã®ããã«ç¨æããã¾ããã

       -W version
       --version
              å®è¡ããã gawk ãã‐
              ã°ã©ã ã®ãã¼ã¸ã§ã³æå ±ãæ¨æºåºåã¸æ¸ãåºãã¾ããããã¯ä¸»ã«ã
              ããªãã使ç¨ãã¦ãã gawk ããã°ã©ã ã Free Software Foundation ãéå¸ãã¦ã
              ãããã°ã©ã ã®ãã¡ãææ°ã®ãã®ã§ãããã©ãããç¥ãå ´åã«ä¾¿å©ã§ãã
              ã¾ããã°ã¬ãã¼ãã®ã¨ãã«ãæç¨ã§ãã (æ¬ãªãã·ã§ã³ãæå®ããã¨ã GNU
              ã³ã¼ãã£ã³ã°è¦ç´ ã«å¾ãã awk
              ã¯ãã ã¡ã«çµäºããæåãæå³ããçµäºã¹ãã¼ã¿ã¹ãè¿ãã¾ãã)

       --     ãªãã·ã§ã³ã®çµäºãæå³ãã¾ããAWK ããã°ã©ã ã« “-”
              ããå§ã¾ããªãã·ã§ã³ã§ã¯ãªã å¼æ°ãä¸ããå ´åã«ä¾¿å©ã§ãã ããã¯ã主ã«ä»ã®
              POSIX ããã°ã©ã ã®å¤ããå¼æ°ã«å¯¾ãã¦è¡ã解é㨠ä¸è²«æ§ãä¿ã¤ããã«ããã¾ãã

       äºæã¢ã¼ãã§ã¯ãä»ã®ãªãã·ã§ã³ã¯ä¸æ£ã§ããã¨ãããããç¡è¦ããã¾ãã
       é常ã®å®è¡ã«ããã¦ãããã°ã©ã ããã¹ããã³ãã³ãã©ã¤ã³ã«æå®ããã¦ããã°ã
       ä¸æãªãªãã·ã§ã³ã¯ãAWK ããã°ã©ã ã« ARGV éåãéãã¦æ¸¡ããã¾ãããã ã¯ãAWK ãã‐
       ã°ã©ã ã “#!” æ©æ§ãç¨ãã¦å®è¡ããå ´åã«ç¹ã«ä¾¿å©ã§ãã

AWK ããã°ã©ã ã®å®è¡
       AWK ããã°ã©ã ã¯ããã¿ã¼ã³ã¨ã¢ã¯ã·ã§ã³ã®çµã®åã¨ã(ããå¿è¦ãªã) é¢æ°å®ç¾©ã
       ããªãã¾ãã

              pattern   { action statements }
              function name(parameter list) { statements }

       gawk ã¯ã¾ãã program-file (è¤æ°å¯) ãæå®ããã¦ããã°ããããã --source
       ã®å¼æ°ããããããã¯ãæåã®ãªãã·ã§ã³ã§ã¯ãªãå¼æ°ãã ããã°ã©ã ãèªã¿è¾¼ã¿ã¾ãã -f ã¨
       --source ãªãã·ã§ã³ã¯ãã³ãã³ãã©ã¤ã³ã§è¤æ°åæå®ã§ãã¾ãã gawk ã¯ããã¹ã¦ã®
       program-file ã¨ã³ãã³ãã©ã¤ã³ã§æå®ããããã°ã©ã ãçµ åãã¦ä½¿ç¨ãã¾ããæ°ããä½ã£ã
       AWK ããã°ã©ã ã²ã¨ã¤ã²ã¨ã¤ã« AWK
       é¢æ°ã®ã©ã¤ãã©ãªãåãè¾¼ãå¿è¦ãç¡ãã®ã§ããã®æ©è½ã¯ã©ã¤ãã©ãªã®æ§ç¯ã« 便å©ã§ãã
       ã¾ããã©ã¤ãã©ãªé¢æ°ã¨ã³ãã³ãã©ã¤ã³ã§æå®ããããã°ã©ã ã¨ãæ··åãã¦ä½¿
       ããã¨ãå¯è½ã«ãã¦ãã¾ãã

       ç°å¢å¤æ° AWKPATH ã«ããã -f
       ãªãã·ã§ã³ã§æå®ããããã¡ã¤ã«ãæ¤ç´¢ãããã¹ãæå®ã§ãã¾ãã AWKPATH ãè¨‐
       å®ããã¦ããªãå ´åã®ããã©ã«ããã¹ã¯ ".:/usr/local/share/awk" ã§ãã
       (å®éã®ãã£ã¬ã¯ããªã¯ gawk ãã©ã®ããã«æ§ç¯/ã¤ã³ã¹ãã¼ã«ããããã«ä¾å‐
       ãã¦ããã¾ãã¾ãªãã®ã¨ãªãã¾ãã) -f ãªãã·ã§ã³ã§æå®ãããã¡ã¤ã«åã “/”
       ãå«ãã§ããå ´åã¯ã ãã¹æ¤ç´¢ã¯è¡ããã¾ããã

       gawk ã¯ã AWK ããã°ã©ã ã次ã®é åºã§å®è¡ãã¾ãã ã¾ãã -v
       ãªãã·ã§ã³ã§æå®ãããå¤æ°ã¸ã®ä»£å¥ããã¹ã¦è¡ãã¾ãã 次ã«ããã‐
       ã°ã©ã ãåé¨å½¢å¼ã«ã³ã³ãã¤ã«ãã¾ãã ããã¦ã(ããåå¨ããã°) BEGIN ããã㯠(è¤æ°å‐
       å¨å¯) ãå®è¡ãã¾ãã éå ARGV ã§æå®ããããã¡ã¤ã«ãé ã«èªã¿ãå¦çãè¡ãã¾ã
       (ã³ãã³ãã©ã¤ã³ã§ãã¡ã¤ã«åã æå®ããã¦ããªããã°ãæ¨æºå¥åã«å¯¾ãã¦å¦çãè¡ãã¾ã)ã

       ã³ãã³ãã©ã¤ã³ã§æå®ããããã¡ã¤ã«åã var=val ã¨ããå½¢å¼ãªãã°ããã
       ã¯å¤æ°ã¸ã®ä»£å¥ã§ããã¨è§£éããã¾ããå¤æ° var ã¯å¤ val ã«è¨å®ããã¾ã
       (ããã¯ããã¹ã¦ã® BEGIN ãããã¯ãå®è¡ãããã¨ã«è¡ããã¾ã)ãã³ãã³ãã©ã¤ã³
       ã§ã®å¤æ°ã®ä»£å¥ã¯ãAWK ãå¥åããã£ã¼ã«ããã¬ã³ã¼ãã«åå²ããããã®ã»ãã¬ã¼ã¿
       ãå®è¡æã«å¤æ´ããã®ã«ä¾¿å©ã§ããã¾ãã1 ã¤ã®ãã¼ã¿ãã¡ã¤ã«ã«
       対ãæ°åå¦çãè¡ãå¿è¦ãããå ´åãç¶æãã³ã³ããã¼ã«ããã®ã«ã便å©ã§ãã

       éå ARGV ã®è¦ç´ ã«ç©º ("") ãããå ´åã gawk ã¯ãã®è¦ç´ ãç¡è¦ãã¾ãã

       gawk ã¯ãå¥åãããåã¬ã³ã¼ãã«å¯¾ãã¦ããããã ãã¿ã¼ã³ ã AWK ããã°ã©ã åã«ãããã©ããã
       æ¤ç´¢ãã¾ãããã®ã¬ã³ã¼ãã«ããããããã¿ã¼ã³ãã¹ã¦ã«ã¤ãã¦ããããã対å¿ãã ã¢ã¯ã·ã§ã³
       ãå®è¡ããã¾ãã ãã¿ã¼ã³ã¯ãããã°ã©ã ããã¹ãã«åºç¾ããé åºã§æ¤ç´¢ããã¾ãã

       å¥åãå°½ããã¨ã gawk 㯠(ããããã°) END ããã㯠(è¤æ°åå¨å¯) ãå®è¡ãã¾ãã

å¤æ°ãã¬ã³ã¼ãããã£ã¼ã«ã
       AWK ã«ãããå¤æ°ã¯åçãããªãã¡ãæåã«ä½¿ç¨ãããã¨ãã«çæããã¾ãã
       å¤æ°ã®å¤ã¯ãæµ®åå°æ°ç¹æ°ããæååãããããã¯ä¸¡æ¹ã§ããå¤æ°ã®ç¨ã
       ããæ¹ã«ããå¤åãã¾ããAWK ã§ã¯ã¾ãã1 次åéåãå©ç¨ãããã¨ãã§ãã¾ãã å¤æ¬¡åéå
       ããæ¬ä¼¼çã«ã§ã¯ããã¾ãããå©ç¨å¯è½ã§ããããã°ã©ã å®è¡éå§æã«ã
       ããã¤ãã®å®ç¾©æ¸ã¿å¤æ°ãè¨å®ããã¾ãã ããããå¿è¦ã«å¿ãã¦èª¬æãã以ä¸ã§ã¾ã¨ãã¾ãã

   ã¬ã³ã¼ã
       é常ãã¬ã³ã¼ãã¯æ¹è¡æåã«ããåºåããã¾ãã ã¬ã³ã¼ãã®åºåãã¯ãçµã¿è¾¼ã¿å¤æ° RS
       ã¸å¤ã代å¥ãããã¨ã«ãããå¶å¾¡ã§ãã¾ãã RS ãåä¸æåã®å ´åããã®æåãã¬ã³ã¼ããåºåãã¾ãã
       ããã§ãªãå ´åã¯ã RS ã¯æ£è¦è¡¨ç¾ã¨ãªãã¾ãã å¥åä¸ã®ããã¹ãã§ããã®æ‐
       £è¦è¡¨ç¾ã«ããããããã®ãã¬ã³ã¼ããåºåãã¾ãã ãããäºæã¢ã¼ãã§ã¯ã æååå¤ã®æåã®æå‐
       ã ãããã¬ã³ã¼ãã»ãã¬ã¼ã¿ã«ä½¿ç¨ããã¾ãã RS ã空æååã«è¨‐
       å®ããã¦ããã¨ãã«ã¯ãã¬ã³ã¼ãã¯ç©ºè¡ã§åºåããã¾ãã RS ã空æååã«è¨å®ãããã¨ãã«ã¯ã
       FS ã®å¤ã«ããããããæ¹è¡æåã¯å¸¸ã«ãã£ã¼ã«ãã»ãã¬ã¼ã¿ã¨ãªãã¾ãã

   ãã£ã¼ã«ã
       å¥åã¬ã³ã¼ããèªã¿è¾¼ããã¨ã«ã gawk ã¯ãã®ã¬ã³ã¼ãã ãã£ã¼ã«ã ã«åå²ãã¾
       ããåå²ããéã«ã¯ãå¤æ° FS ã®å¤ããã£ã¼ã«ãã»ãã¬ã¼ã¿ã¨ãã¦åç§ããã¾ãã FS ã®å¤ã1æå‐
       ãªãããã® æåãå¢ã«ãã£ã¼ã«ããåå²ããã¾ãã FS ã空æååã®å ´åãåãã®æå‐
       ããã£ã¼ã«ãã»ãã¬ã¼ã¿ã¨ãªãã¾ãã ãããã§ããªãå ´åã FS ã¯å®å¨ãªæ£è¦è¡¨ç¾ã§ãã
       ã¨è§£éããã¾ããç¹æ®ãªå ´åã¨ã㦠FS ãåä¸ã®ç©ºç½ã®ã¨ãã«ã¯ããã£ã¼ã«ãã¯
       é£ç¶ãã空ç½ã»ã¿ãã»æ¹è¡ã«ããåå²ããã¾ãã (å¾è¿°ã® --posix ã®è‐
       °è«ãåç§ãã¦ãã ãã)ã å¤æ° IGNORECASE (ä¸è¨åç§) ã® å¤ã¯ã FS ãæ‐
       £è¦è¡¨ç¾ã®å ´åãã£ã¼ã«ãåå²ã«ãå½±é¿ãä¸ãããã¨ã¨ã RS ãæ‐
       £è¦è¡¨ç¾ã®å ´åã¬ã³ã¼ãåå²ã«ãå½±é¿ãä¸ãããã¨ã«æ³¨æãã¦ãã ããã

       å¤æ° FIELDWIDTHS ã®å¤ã空ç½ã§åºåãããæ°åã®åã§ããå ´åãåãã£ã¼ã«ãã¯
       åºå®é·ã§ããã¨è§£éããã gawk ã¯æå®ãããå¹ãã¨ã«ãã£ã¼ã«ãã® åå²ãè¡ãã¾ãããã®å ´åã
       FS ã®å¤ã¯ç¡è¦ããã¾ãã FS ã«æ°ãã«å¤ãè¨å® ãããã¨ã«ããããã® FIELDWIDTHS
       ã®å¹æãæã¡æ¶ããæ¨æºã®åä½ã«æ»ããã¨ãã§ãã¾ãã

       å¥åã¬ã³ã¼ãä¸ã®åãã£ã¼ã«ãã®å¤ã¯ãå·¦ãã $1, $2 çã¨ããååã§åç§ã§ãã¾ãã $0 ã¯
       ã¬ã³ã¼ãå¨ä½ã§ãããã£ã¼ã«ãã«å¤ã代å¥ãããã¨ãã§ãã¾ãããã£ã¼ã«ãã¯å®æ°ã
       ãã§ãªããå¤æ°ã«ãã£ã¦åç§ãããã¨ãã§ãã¾ãã以ä¸ã®ä¾ã§ã¯ãå¥åã¬ã³ã¼ãã® 5
       çªç®ã®ãã£ã¼ã«ãã®å¤ãåºåãã¾ãã

              n = 5
              print $n

       å¤æ° NF ã¯ãèªåçã«å¥åã¬ã³ã¼ãã®ãã£ã¼ã«ãã®æ°ã«è¨å®ããã¾ãã

       åå¨ããªããã£ã¼ã«ã (ããªãã¡ã $NF ããå³ã®ãã£ã¼ã«ã) ãåç§ããçµæ㯠空æå‐
       åã«ãªãã¾ããããããªãããåå¨ããªããã£ã¼ã«ãã¸ã®ä»£å¥(ãã¨ã ã°ã $(NF+2)=5 ) 㯠NF
       ã®å¤ãå¢å ãããéã®ãã£ã¼ã«ãã«ã¯ç©ºæåãè¨å®ããã¾ãã ããã« $0
       ã®å¤ã¯ããã£ã¼ã«ãã®å¤ãå¤æ° OFS ã®å¤ã§ãã£ã¼ã«ããåºåã£ããã®ã¨ãã¦åè¨ç®ããã¾ãã
       è² ã®ãã£ã¼ã«ãçªå·ã¸ã®åç§ã¯è´å½çã¨ã©ã¼ã¨ãªãã¾ãã NF
       ãæ¸å°ãããã¨ãæ°ããå¤ãè¶ãããã£ã¼ã«ãã®å¤ã¯å¤±ããã¾ãã $0
       ã®å¤ã¯ããã£ã¼ã«ãã®å¤ãå¤æ° OFS ã®å¤ã§ãã£ã¼ã«ããåºåã£ããã®ã¨ãã¦åè¨ç®ããã¾ãã

   çµã¿è¾¼ã¿å¤æ°
       gawk ã®çµã¿è¾¼ã¿å¤æ°ã¯ä»¥ä¸ã®ã¨ããã§ãã

       ARGC        ã³ãã³ãã©ã¤ã³å¼æ°ã®åæ° ( gawk ã¸ã®ãªãã·ã§ã³ã¨ããã‐
                   ã°ã©ã æå®ã¯å«ã¿ã¾ ãã)ã

       ARGIND      ç¾å¨å¦çä¸ã®ãã¡ã¤ã«åãæ ¼ç´ããã¦ããéå ARGV ã®ã¤ã³ããã¯ã¹ã

       ARGV        ã³ãã³ãã©ã¤ã³å¼æ°ã®éåãéåã¯ã 0 ãã ARGC - 1 ã¾ã§ã®ã¤ã³ããã¯ã¹ã
                   æã¡ã¾ãã ARGV ã®å容ãå¤æ´ãããã¨ã§ãå¥åã«ç¨ãããã¡ã¤ã«åãå¤
                   æ´ãããã¨ãã§ãã¾ãã

       CONVFMT     æ°å¤ã®å¤æãã©ã¼ããããããã©ã«ãå¤ã¯ "%.6g" ã§ãã

       ENVIRON     ç¾å¨ã®ç°å¢å¤æ°ã®å¤ãããªãéåãéåã¯ãç°å¢å¤æ°åã«ããã¤ã³ããã¯ã¹ãã
                   ãåè¦ç´ ã®å¤ã¯ãã®ç°å¢å¤æ°ã®å¤ã§ã (ä¾ãã° ENVIRON["HOME"] ã¯
                   /home/arnold ã¨ãªãã§ããã)ãæ¬éå㫠代å¥ãè¡ã£ã¦ãã gawk
                   ãããªãã¤ã¬ã¯ãã system() é¢æ°ã«ããå®è¡ããã ãã‐
                   ã°ã©ã ã®ç°å¢ã«ã¯å½±é¿ãä¸ãã¾ãã(ããã¯ãå°æ¥ã® gawk
                   ã§ã¯å¤æ´ãããå¯è½æ§ãããã¾ã)ã

       ERRNO       getline ã®ãªãã¤ã¬ã¯ãã getline ã«ããèªã¿è¾¼ã¿ã close()
                   é¢æ°ã®å®è¡æã®ããããã«ã·ã¹ãã ã¨ã©ã¼ãçºçããå ´åãå¤æ° ERRNO
                   ã«ã¯ã¨ã©ã¼ã®å容ã示ããæååãè¨å®ããã¾ãã

       FIELDWIDTHS 空ç½ã§åºåããããã£ã¼ã«ãé·ã®ãªã¹ãããããã®å¤ãè¨å®ããã¦ããã°ã gawk
                   㯠FS ã®å¤ãç¨ãã¦ãã£ã¼ã«ãåå²ãããããã«ãåºå®é·ã®ãã£ã¼ã«ãåå²ãè¡
                   ãã¾ããåºå®é·ã®ãã£ã¼ã«ãåå²æ©è½ã¯ã¾ã å®é¨çãªãã®ã§ã gawk
                   ãæ¹è¯ãããã«å¾ã£ã¦æå³ãå¤åããå¯è½æ§ãããã¾ãã

       FILENAME    ç¾å¨ã®å¥åãã¡ã¤ã«åããããã³ãã³ãã©ã¤ã³ã§å¥åãã¡ã¤ã«ãæå®ããã¦ã
                   ãªããã°ã FILENAME ã®å¤ã¯ “-” ã§ããããããªããã BEGIN ãããã¯åã§ã¯
                   FILENAME ã¯æªå®ç¾©ã§ãã

       FNR         ç¾å¨ã®å¥åãã¡ã¤ã«ã«ãããå¥åã¬ã³ã¼ãçªå·ã

       FS          å¥åãã£ã¼ã«ãã»ãã¬ã¼ã¿ãããã©ã«ãã§ã¯åä¸ã®ç©ºç½ã§ãã ä¸è¿°ã®
                   ãã£ã¼ã«ã ãåç§ãã¦ãã ããã

       IGNORECASE  ãã¹ã¦ã®æ£è¦è¡¨ç¾ã¨æååæä½ã«ããã¦å¤§æåå°æåã®åºå¥ãå¶å¾¡ãã¾ããããã
                   IGNORECASE ã 0 ã§ãªãå¤ã«è¨å®ããã¦ããã°ãæå‐
                   åæ¯è¼ãã«ã¼ã«ã®ãã¿ã¼ã³ãããã FS ã«ãããã£ã¼ã«ãåå²ã RS
                   ã«ããã¬ã³ã¼ãåå²ã ~ 㨠!~ ã«ããæ£è¦è¡¨ç¾ããããå®ç¾©æ¸ã¿é¢æ°
                   gensub(), gsub(), index(), match(), split(), sub()
                   ã«ããã¦å¤§æåã¨å°æåã®éãã¯ç¡è¦ããã¾ãããã®ããã IGNORECASE ã 0
                   以å¤ã®å¤ãªãã /aB/ 㯠"ab", "aB", "Ab", "AB"
                   ã®ãããã«ãããããããã¨ã«ãªãã¾ãã ä»ã®AWK å¤æ°ã¨åæ§ã« IGNORECASE
                   ã®åæå¤ã¯ 0 ãªã®ã§ãé常㯠æ£è¦è¡¨ç¾ã¨æååæä½ã«ããã¦å¤§æå‐
                   ã¨å°æåã¯åºå¥ããã¾ãã Unix ã§ã¯ã大æåå°æåãç¡è¦ããå ´åã ISO
                   8859-1 Latin-1 æåéåå¨ã¦ã使ç¨ã§ãã¾ãã 注: 3.0 以åã® gawk
                   ã§ã¯ IGNORECASE ã¯æ£è¦è¡¨ç¾æä½ã®ã¿ã«å½±é¿ãã¾ãããç¾å¨ã¯æå‐
                   åæ¯è¼ã«ãå½±é¿ãã¾ãã

       NF          ç¾å¨ã®å¥åã¬ã³ã¼ãã®ãã£ã¼ã«ãæ°ã

       NR          ç¾å¨ã¾ã§ã«èªã¿è¾¼ãã å¥åã¬ã³ã¼ãæ°ã®åè¨ã

       OFMT        æ°åã®åºåãã©ã¼ããããããã©ã«ãå¤ã¯ "%.6g" ã§ãã

       OFS         åºåãã£ã¼ã«ãã»ãã¬ã¼ã¿ãããã©ã«ãã¯ç©ºç½ã§ãã

       ORS         åºåã¬ã³ã¼ãã»ãã¬ã¼ã¿ãããã©ã«ãã¯æ¹è¡ã§ãã

       RS          å¥åã¬ã³ã¼ãã»ãã¬ã¼ã¿ãããã©ã«ãã¯æ¹è¡ã§ãã

       RT          ã¬ã³ã¼ãã¿ã¼ããã¼ã¿ã gawk ã¯ã RS ã§æå®ãããæåã¾ãã¯æ‐
                   £è¦è¡¨ç¾ã«ãããããå¥åããã¹ããã RT ã«è¨å®ãã¾ãã

       RSTART      match() ã«ãããããããæåã®æåã®ä½ç½®ã0 ã¯ãããããªãã£ããã¨ã示ãã¾ãã

       RLENGTH     match() ã«ãããããããæååã®é·ãã-1 ã¯ãããããªãã£ããã¨ã示ãã¾ãã

       SUBSEP      å¤æ¬¡åéåãå®ç¾ããéã«ç¨ãããããéåã®ã¤ã³ããã¯ã¹ãçµåããæåã
                   ããã©ã«ãå¤ã¯ "\034" ã§ãã

   éå
       éåã¯ããã©ã±ãã ([ 㨠]) ã®éã®å¼ã«ãã£ã¦ã¤ã³ããã¯ã¹ãæå®ãã¾ããããå¼ãå¼
       ã®ãªã¹ã(å¼, å¼ ...) ãªããå¼ã®å¤ãå¤æ° SUBSEP ã®å¤ãåºåãã¨ã㦠çµåããæå‐
       åãã¤ã³ããã¯ã¹ã¨ãã¦ç¨ãã¾ããããã«ãããå¤æ¬¡åéåã ã·ãã¥ã¬ã¼ããã¦ãã¾ããä¾ãã°ã

              i = "A"; j = "B"; k = "C"
              x[i, j, k] = "hello, world\n"

       ã¯ãæåå "hello, world\n" ããæåå "A\034B\034C" 㧠ã¤ã³ããã¯ã¹ããéå x
       ã®è¦ç´ ã«ä»£å¥ãã¦ãã¾ãã AWK ã®éåã¯ãã¹ã¦ãæååã«ããã¤ã³ããã¯ã¹ãè¡ãé£æ³éåã§ãã

       ç¹æ®ãªæ¼ç®å in ã if ã¾ã㯠while
       ã¹ãã¼ãã¡ã³ãã§ç¨ãããã¨ã«ãã£ã¦ãããã¤ã³ããã¯ã¹å¤ã«
       ãããéåã®å¤ãå®ç¾©ããã¦ãããã調ã¹ããã¨ãã§ãã¾ãã

              if (val in array)
                   print array[val]

       ãããéåãå¤æ¬¡åã¤ã³ããã¯ã¹ãæã¤ãªãã (i, j) in array ãç¨ãã¾ãã

       in ã¯ã¾ãã for ã«ã¼ãä¸ã§ãéåã®ãã¹ã¦ã®ã¤ã³ããã¯ã¹å¤ã«ã¤ãã¦ç¹°ãè¿ãããã«
       ç¨ãããã¨ãã§ãã¾ãã

       éåã®è¦ç´ ã¯ã delete ã¹ãã¼ãã¡ã³ããç¨ãã¦åé¤ãããã¨ãã§ãã¾ãã delete
       ã¹ãã¼ãã¡ã³ãã¯ã¾ãã æ·»åãæå®ããã«éååã®ã¿ãæå®ãããã¨ã«ããã
       éåå¨ä½ãåé¤ããããã«ã使ãã¾ãã

   å¤æ°ã®åã¨å¤æ
       å¤æ°ã¨ãã£ã¼ã«ãã¯ã(æµ®åå°æ°ç¹æ°ã®) æ°å¤ã¾ãã¯æååããããã¯ä¸¡æ¹ã¨ã㦠æ±ããã¾ãã
       å¤æ°ã®å¤ãã©ã®ããã«è§£éããããã¯ãå¤æ°ã®ä½¿ããæ¹ã«ãã£ã¦å¤åãã¾ãã æ°å¼ä¸‐
       ã§ç¨ããããã°å¤æ°ã¯æ°å¤ã¨ãã¦è§£éãããæååã¨ãã¦ç¨ãããã ã°æååã¨ãã¦è§£éããã¾ãã

       å¤æ°ã®å¤ãå¼·å¶çã«æ°å¤ã§ããã¨è§£éããããå ´åã¯ãå¤æ°ã« 0 ãå ãã¾ãã æå‐
       åã¨è§£éããããå ´åã¯ç©ºæååãçµåãã¾ãã

       æååãæ°å¤ã«å¤æããå¿è¦ãããå ´åãå¤æ㯠atof(3) ã«ãã£ã¦è¡ããã¾ãã æ°å¤ãæå‐
       åã«å¤æããå ´åã¯ãå¤æ° CONVFMT ã®å¤ããã©ã¼ãããæååã¨ãã¦ç¨ãã¦ã sprintf(3)
       ã«ããè¡ããã¾ããAWK ã§ã¯ãã¹ã¦ã®æ°å¤ã¯æµ®åå°æ°ç¹æ°ã§ãããæ´æ°å¤ã¯å¸¸ã«æ´æ°
       ã¨ãã¦å¤æãè¡ããã¾ãã ãã£ã¦ã以ä¸ã®å ´åã

              CONVFMT = "%2.2f"
              a = 12
              b = a ""

       å¤æ° b ã¯æååå¤ "12" ã¨ãªãã"12.00" ã¨ã¯ãªãã¾ããã

       gawk ã¯ã以ä¸ã®ããã«ãã¦æ¯è¼ãè¡ãã¾ã: 2 ã¤ã®å¤æ°ãæ°å¤ãªãæ°å¤ã¨ãã¦æ¯
       è¼ãã¾ããããçæ¹ãæ°å¤ã§çæ¹ã`æ°å¤'æååãªããæ°å¤ã¨ãã¦æ¯è¼ããã¾ãã
       çæ¹ãæ°å¤ã§ãªãæååãªããæ°å¤ã®ã»ããæååã«å¤æãããæååã¨ã㦠æ¯è¼ããã¾ãã両æ¹ã¨ãæå‐
       åãªããæååã¨ãã¦æ¯è¼ããã¾ããPOSIX æ¨æºã«å¾ã ãªãã両æ¹ã¨ãæ°å¤æå‐
       åã®å ´åã¯æ°å¤ã¨ãã¦æ¯è¼ãã¾ãããããã¯æã ãã«ééãã§ãã gawk ã¯ãã®ãããªåä½ããã¾ããã

       "57" ã®ãããªæååå®æ°ã¯æ°å¤æååã§ã¯ ãªã ãæååå®æ°ã§ãããæ°å¤æå‐
       åãã®æ¦å¿µã¯ããã£ã¼ã«ãã getline ã®å¥åã FILENAME ã ARGV ã®è¦ç´ ã ENVIRON
       ã®è¦ç´ ãæ°å¤æååãã split() ã«ãã£ã¦ä½æãããéåã®è¦ç´ ã«å¯¾ãã¦ã®ã¿é©ç¨ããã¾ãã
       åºæ¬çãªèãæ¹ã§ã¯ã ã¦ã¼ã¶å¥å
       ããããæ°å¤ã«è¦ããã¦ã¼ã¶å¥åã®ã¿ãæ°å¤ã¨ãã¦æ±ããã¾ãã

       åæåããã¦ããªãå¤æ°ã¯ãæ°å¤ã¨ãã¦ã¯ 0 ããæååã¨ãã¦ã¯ "" (空æåå) ã æã¡ã¾ãã

ãã¿ã¼ã³ã¨ã¢ã¯ã·ã§ã³
       awk ã¯è¡æåã®è¨èªã§ããã¾ããã¿ã¼ã³ã次ã«ã¢ã¯ã·ã§ã³ãç¶ãã¾ãã ã¢ã¯ã·ã§ã³ã¯ {
       㨠} ã§å²ã¿ã¾ãããã¿ã¼ã³ã¾ãã¯ã¢ã¯ã·ã§ã³ã¯çç¥ãããã¨ãã§ãã¾ãã ãã¡ããã両æ¹ã¨ã
       çç¥ãã¦ãã¾ã£ã¦ã¯æå³ãããã¾ããã
       ãã¿ã¼ã³ããªãå ´åãã¢ã¯ã·ã§ã³ã¯ãã¹ã¦ã®å¥åã¬ã³ã¼ãã«
       対ãã¦é©ç¨ããã¾ããçç¥ãããã¢ã¯ã·ã§ã³ã¯ä»¥ä¸ã¨ç価ã§ãã

              { print }

       ããã¯ã¬ã³ã¼ãå¨ä½ãåºåãã¾ãã

       ã³ã¡ã³ãã¯æå “#” ã§å§ã¾ããè¡æ«ã¾ã§ç¶ãã¾ãã空è¡ã¯ãè¤æ°ã¹ãã¼ãã¡ã³ãã®
       éããããã®ã«ä½¿ããã¨ãã§ãã¾ãã é常ãã¹ãã¼ãã¡ã³ãã¯æ¹è¡ã§çµããã¾ãããã ãã
       次ã®è¨å·ã§è¡ãçµããå ´åã«ã¯ãã®éãã§ã¯ããã¾ãã: “,”, {, ?, :, &&, || ã do
       ã¾ã㯠else ã§çµããè¡ã¯ãã¹ãã¼ãã¡ã³ããèªåçã«ä»¥é
       ã®è¡ã¸ç¶ç¶ããã¾ããã¾ããæ¹è¡ã®ç´åã« “\” ãç½®ããã¨ã§ã
       è¡ãç¶ç¶ãããã¨ãã§ãã¾ãããã®å ´åããã®æ¹è¡ã¯ç¡è¦ããã¾ãã

       “;” ã§åºåããã¨ã«ããã1è¡ã«è¤æ°ã®ã¹ãã¼ãã¡ã³ããè¨è¿°ãããã¨ãã§ãã¾ãã
       (é常ã®ããã«) ãã¿ã¼ã³-ã¢ã¯ã·ã§ã³å¯¾ä¸‐
       ã®ã¢ã¯ã·ã§ã³é¨ã«ãããã¹ãã¼ãã¡ã³ãã ãã§ã¯ãªãã
       ãã¿ã¼ã³-ã¢ã¯ã·ã§ã³å¯¾ã¹ãã¼ãã¡ã³ãèªèº«ãã
        “;” ã§åºåã£ã¦è¤æ°ç½®ããã¨ãã§ãã¾ãã

   ãã¿ã¼ã³
       AWK ã®ãã¿ã¼ã³ã¯ã以ä¸ã®ãã¡ã®ããããã§ãã

              BEGIN
              END
              /regular expression/
              relational expression
              pattern && pattern
              pattern || pattern
              pattern ? pattern : pattern
              (pattern)
              ! pattern
              pattern1, pattern2

       BEGIN 㨠END ã¯ç¹æ®ãªãã¿ã¼ã³ã§ãããå¥åã¨æ¯è¼ããããã¨ã¯ããã¾ããããã¹ã¦ã® BEGIN
       ãã¿ã¼ã³ã«å¯¾å¿ããã¢ã¯ã·ã§ã³é¨ã¯çµåããã ãã®ãããªãã¹ã¦ã®ã¢ã¯ã·ã§ã³é¨ãåä¸ã®
       BEGIN ãããã¯ä¸ã«ãããã®ããã«æ±ããã¾ãã çµåãããã¢ã¯ã·ã§ã³ã¯ã
       ãã¹ã¦ã®å¥åãã¡ã¤ã«ã®èªã¿è¾¼ã¿ã«åç«ã£ã¦å®è¡ããã¾ããåæ§ã«ãã¹ã¦ã® END ãã‐
       ãã¯ã¯çµåããããã¹ã¦ã®å¥åãã¡ã¤ã«ã®å¦çå¾ (ãããã¯ãexit ã¹ãã¼ãã¡ã³ã
       ãå®è¡ãããã¨ã) ã«å®è¡ããã¾ãã BEGIN 㨠END
       ã¯ãã¿ã¼ã³å¼åã§ä»ã®ãã¿ã¼ã³ã¨æ··ãã¦ä½¿ããã¨ã¯ã§ãã¾ãããã¾ãã BEGIN 㨠END
       ãã¿ã¼ã³ã¯ã¢ã¯ã·ã§ã³é¨ãçç¥ãããã¨ãã§ãã¾ããã

       /regular expression/ ãã¿ã¼ã³ã§ã¯ãæ£è¦è¡¨ç¾ (regular expression)
       ã«ãããããå¥åã¬ã³ã¼ãã«å¯¾ãã¦ã¢ã¯ã·ã§ã³ ãå®è¡ããã¾ããæ£è¦è¡¨ç¾ã¯ egrep(1)
       ã¨åããã®ã使ãã¾ãããã¨ã«è¦ç´ã示ãã¾ãã

       é¢ä¿å¼(relational expression)
       ã§ã¯ãå¾è¿°ã®ã¢ã¯ã·ã§ã³ã«ã¤ãã¦ã®ç¯ã§ç¤ºãæ¼ç®åãç¨ãããã¨ã ã§ãã¾ãã
       ãããã¯æ¦ãã¦ãç¹å®ã®ãã£ã¼ã«ããæ£è¦è¡¨ç¾ã«ããããããã©ããã 調ã¹ãããã«ç¨ãããã¾ãã

       æ¼ç®å &&, ||, !  ã¯ããããã C è¨èªã§ã®è«çANDãè«çORãè«çNOT ã¨ç価ã§ãã C
       è¨èªã¨åæ§ã«ãè©ä¾¡å¤ã確å®ããæç¹ã§ä»¥éã®è©ä¾¡ãæã¡åãã¾ãã
       ãããã¯è¤æ°ã®ãã¿ã¼ã³å¼ãçµåããããã«ä½¿ç¨ããã¾ãã ä»ã®ãã‐
       ã°ã©ãã³ã°è¨èªã¨åæ§ãæ¬å¼§ã«ãã£ã¦è©ä¾¡é åºãå¤æ´ãããã¨ãã§ãã¾ãã

       ?: æ¼ç®å㯠C è¨èªã®ãã®ã¨åæ§ã§ãããããæåã®ãã¿ã¼ã³ãçãªãã ãã¹ãã®ããã« 2
       çªç®ã®ãã¿ã¼ã³ãç¨ããããããã§ãªããã° 3 çªç®ã®ãã¿ã¼ã³ã ç¨ãããã¾ãã2 çªç®ã¨ 3
       çªç®ã®ãã¿ã¼ã³ã®ã©ã¡ããã ããè©ä¾¡ããã¾ãã

       pattern1, pattern2 å½¢å¼ã¯ ç¯å²ãã¿ã¼ã³ ã¨å¼ã°ãã¾ããç¯å²ãã¿ã¼ã³ã¯ã
       pattern1 ã«ãããããã¬ã³ã¼ãããã pattern2 ã«ãããããã¬ã³ã¼ãã¾ã§ã®ãã¹ã¦ã«ããããã¾ãã
       ãã®å½¢å¼ã¯ãä»ã®ãã¿ã¼ã³å¼ã¨æ··åãã¦ç¨ãããã¨ã¯ã§ãã¾ããã

   æ£è¦è¡¨ç¾
       awk ã®æ£è¦è¡¨ç¾ã¯ egrep ã®ãã®ã¨åæ§ã«ãæ¡å¼µãããæ£è¦è¡¨ç¾ã§ãã
       以ä¸ã®æ§æè¦ç´ ããæãç«ã£ã¦ãã¾ãã

       c          ã¡ã¿æåã§ã¯ãªã c ã«ããããã¾ãã

       \c         ãªãã©ã«æå c ã«ããããã¾ãã

       .          æ¹è¡ã å«ã ä»»æã® 1 æåã«ããããã¾ãã

       ^          æååã®åé ã«ããããã¾ãã

       $          æååã®çµç«¯ã«ããããã¾ãã

       [abc...]   æåãªã¹ãã§ããã abc...  ã®ãããã 1 æåã«ããããã¾ãã

       [^abc...]  æåãªã¹ãã®éã§ããã abc...  以å¤ã® 1 æåã«ããããã¾ãã

       r1|r2      é¸è¨: r1 ã¾ã㯠r2 ã«ããããã¾ãã

       r1r2       çµå: r1 ã®ç´å¾ã« r2 ãç¶ããã®ã«ããããã¾ãã

       r+         r ã® 1 å以ä¸ã®ç¹°ãè¿ãã«ããããã¾ãã

       r*         r ã® 0 å以ä¸ã®ç¹°ãè¿ãã«ããããã¾ãã

       r?         r ã® 0 åã¾ã㯠1 åã®ç¹°ãè¿ãã«ããããã¾ãã

       (r)        ã°ã«ã¼ãå: r ã«ããããã¾ãã

       r{n}
       r{n,}
       r{n,m}     ãã¬ã¼ã¹ä¸ã« 1 ã¤ã 2 ã¤ã®æ°å¤ãè¨è¿°ãããã¨ã«ããã
                  ã¤ã³ã¿ã¼ãã«è¡¨ç¾ ã表ãã¾ãããã¬ã¼ã¹ä¸ã«æ°å¤ã 1
                  ã¤ããå ´åãç´åã®æ£è¦è¡¨ç¾ r ã n åç¹°ãè¿ããã¾ãã2
                  ã¤ã®æ°å¤ãã³ã³ãã§åºåããã¦ããå ´åã r 㯠n åãã m åç¹°ãè¿ããã¾ãã1
                  ã¤ã®æ°å¤ã«ç¶ãã¦ã³ã³ããããå ´åã r ã¯å°ãªãã¨ã n åç¹°ãè¿ããã¾ãã
                  ã¤ã³ã¿ã¼ãã«è¡¨ç¾ã¯ --posix ã¾ã㯠--re-interval
                  ãã³ãã³ãã©ã¤ã³ã«ã¦æå®ããã¦ããã¨ãã®ã¿å©ç¨å¯è½ã§ãã

       \y         èªã®åé ã¾ãã¯æ«å°¾ã®ç©ºæååã«ããããã¾ãã

       \B         èªã®ä¸ã®ç©ºæååã«ããããã¾ãã

       \<         èªã®åé ã®ç©ºæååã«ããããã¾ãã

       \>         èªã®æ«å°¾ã®ç©ºæååã«ããããã¾ãã

       \w         èªãæ§æããæå (ã¬ã¿ã¼ãæ°å¤ãã¢ã³ãã¹ã³ã¢) ã«ããããã¾ãã

       \W         èªãæ§æããæå以å¤ã®æåã«ããããã¾ãã

       \`         ãããã¡ (æåå) ã®åé ã®ç©ºæååã«ããããã¾ãã

       \'         ãããã¡ã®æ«å°¾ã®ç©ºæååã«ããããã¾ãã

       æååå®æ°ä¸ã§ç¨ãããã¨ãã§ããã¨ã¹ã±ã¼ãã·ã¼ã±ã³ã¹ (å¾è¿°åç§) ã¯ã æ£è¦è¡¨ç¾ä¸‐
       ã§ã使ç¨ãããã¨ãã§ãã¾ãã

       æåã¯ã©ã¹ 㯠POSIX æ¨æºã§å°å¥ãããæ°æ©è½ã§ãã æåã¯ã©ã¹ã¯ç¹å®ã®å±æ§ãæã¤æå‐
       åãªã¹ãã®ç¹æ®è¡¨ç¾ã§ããã å®éã®æåéåèªèº«ã¯å½ãæåéåã«ãã£ã¦æ§ããªãã®ã¨ãªãã¾ãã
       ä¾ãã°ãã¢ã«ãã¡ãããæåã¯ã¢ã¡ãªã«åå·å½ã¨ãã©ã³ã¹ã¨ã§ã¯ç°ãªãã¾ãã

       æåã¯ã©ã¹ãæå¹ãªã®ã¯ã æåãªã¹ãã®ãã©ã±ããã®ä¸ã®æ£è¦è¡¨ç¾ã ãã§ãã æåã¯ã©ã¹ã¯ã
       [: ã¨ãã¯ã©ã¹ã表ç¾ãããã¼ã¯ã¼ãã¨ã :] ã§æ§æããã¾ãã 以ä¸ã« POSIX
       表ç¾ã§å®ç¾©ãããæåã¯ã©ã¹ã示ãã¾ãã

       [:alnum:]
              ã¢ã«ãã¡ãããã¨æ°å¤æåã

       [:alpha:]
              ã¢ã«ãã¡ãããæåã

       [:blank:]
              空ç½ã¨ã¿ãæåã

       [:cntrl:]
              å¶å¾¡æåã

       [:digit:]
              æ°å¤æåã

       [:graph:]
              å°åå¯è½ã§å¯è¦ãªæåã (空ç½ã¯å°åå¯è½ã§ããè¦ãã¾ãããä¸æ¹ a ã¯å°å‐
              å¯è½ãã¤å¯è¦ã§ãã)

       [:lower:]
              ã¢ã«ãã¡ãããæåã®å°æåã

       [:print:]
              å°åå¯è½ãªæå (å¶å¾¡æå以å¤)ã

       [:punct:]
              å¥èªç¹æå (ã¬ã¿ã¼ãæ°å¤ãå¶å¾¡æåã空ç½æåã®ãããã§ããªãæå)ã

       [:space:]
              空ç½æå (空ç½ãã¿ãããã©ã¼ã ãã£ã¼ãçã®å°æ°ã®æåãæã)ã

       [:upper:]
              ã¢ã«ãã¡ãããæåã®å¤§æåã

       [:xdigit:]
              16 é²æ°ã®æ°å¤ã

       ä¾ãã°ãPOSIX æ¨æºä»¥åã§ã¯ãã¢ã«ãã¡ãããã¨æ°å¤ã®æåã«ãããããããã«ã¯ã
       /[A-Za-z0-9]/ ã¨æ¸ãã¾ãããããããå¥ã®ã¢ã«ãã¡ãããæåãæåéåã«å«ã¾ããå ´åã
       ãããã«ã¯ããããã¾ããã POSIX æåã¯ã©ã¹ã§ã¯ã /[[:alnum:]]/ ã¨è¨è¿°ãããã¨ãã§ããæå‐
       éåã® ãã¹ã¦ ã®ã¢ã«ãã¡ãããã¨æ°å¤ã«ããããã¾ãã

       æåãªã¹ãä¸ã«ã¯ãæ´ã« 2 ã¤ã®ç¹æ®ã·ã¼ã±ã³ã¹ã使ç¨ã§ãã¾ãã ãããã¯ã è¤æ°ã®æå‐
       ã«ãã£ã¦è¡¨ç¾ãããåä¸ã·ã³ãã« ( ç§åæå ã¨å¼ã°ãã¾ã) ãæã¡ã è¤æ°ã®æåã åç§
       ãã½ã¼ãã«ããã¦ã¯ç価ã§ããã¨ããããé ASCII æåéåã«é©ç¨ããã¾ãã
       (ä¾ãã°ããã©ã³ã¹èªã§ã¯åãªã “e” ã¨ã°ã¬ã¼ãã¢ã¯ã»ã³ãä»ãã® e` ã¨ã§ã¯ ç‐
       価ã§ãã)

       ç§åã·ã³ãã«
              åç§ã·ã³ãã«ã¯è¤æ°æåã®åç§è¦ç´ ã§ããã [.  㨠.]  ã§æ¬ãã¾ãã ä¾ãã°ã ch
              ãåç§è¦ç´ ã®å ´åã [[.ch.]]  ã¯æ‐
              £è¦è¡¨ç¾ã¨ãªãããã®åç§è¦ç´ ã«ããããã¾ãã ä¸æ¹ã [ch] 㯠c ã h
              ã«ãããããæ£è¦è¡¨ç¾ã§ãã

       ç価ã¯ã©ã¹
              ç価ã¯ã©ã¹ã¯ ç価ãªæåãªã¹ããæããã±ã¼ã«åºæã®ååã§ããåå㯠[= 㨠=]
              ã§æ¬ãã¾ãã ä¾ãã°ãåå e 㯠“e,” “e`,”, “e`.”
              ã®ãã¹ã¦ã表ç¾ããããã«ä½¿ç¨ãããããããã¾ããã ãã®å ´åã [[=e=]] 㯠e, ,
              e` ã®ããããã«ãããããæ£è¦è¡¨ç¾ã¨ãªãã¾ãã

       ãããã®æ©è½ã¯è±èªä»¥å¤ã®ãã±ã¼ã«ã«ã¦é常ã«æç¨ã§ãã gawk ãæ‐
       £è¦è¡¨ç¾ã®ãããã³ã°ã«ä½¿ç¨ããã©ã¤ãã©ãªé¢æ°ã¯ã ç¾å¨ POSIX æå‐
       ã¯ã©ã¹ã®ã¿ãç解ãã åç§ã·ã³ãã«ã¨ç価ã¯ã©ã¹ã¯ç解ãã¾ããã

       \y, \B, \<, \>, \w, \W, \`, \' ã®æ¼ç®å㯠gawk åºæã§ãããGNU æ‐
       £è¦è¡¨ç¾ã©ã¤ãã©ãªã®æ©è½ãåã«ããæ¡å¼µã§ãã

       æ§ããªã³ãã³ãã©ã¤ã³ãªãã·ã§ã³ã«ãã£ã¦ãæ£è¦è¡¨ç¾ä¸ã®æåã gawk
       ãã©ã®ããã«è§£éããã®ããå¶å¾¡ã§ãã¾ãã

       ãªãã·ã§ã³ç¡ã
              ããã©ã«ãã§ã¯ã gawk ã¯ä¸è¿°ã® POSIX æ£è¦è¡¨ç¾ããã³ GNU æ‐
              £è¦è¡¨ç¾ã®ãã¹ã¦ã®æ©è½ãæä¾ãã¾ãã
              ããããªãããã¤ã³ã¿ã¼ãã«è¡¨ç¾ã¯ãµãã¼ãããã¾ããã

       --posix
              POSIX æ£è¦è¡¨ç¾ã®ã¿ããµãã¼ããããGNU æ¼ç®åã¯ãµãã¼ãããã¾ãã (ä¾ãã°ã \w
              ã¯ãªãã©ã« w ã«ããããã¾ã)ã ã¤ã³ã¿ã¼ãã«è¡¨ç¾ã¯è¨±ããã¾ãã

       --traditional
              ä¼çµ±ç㪠Unix awk ã®æ£è¦è¡¨ç¾ããµãã¼ãããã¾ããGNU æ¼ç®å‐
              ãã¤ã³ã¿ã¼ãã«è¡¨ç¾ã POSIX æåã¯ã©ã¹ ( [[:alnum:]] ãªã©)
              ã¯ãµãã¼ãããã¾ããã 8 é²ã¾ã㯠16
              é²ã®ã¨ã¹ã±ã¼ãã·ã¼ã±ã³ã¹ã§è¡¨ç¾ãããæåã¯ã æ£è¦è¡¨ç¾ã®ã¡ã¿æå‐
              ã表ç¾ããã¨ãã¦ãã ãªãã©ã«ã¨ãã¦æ±ããã¾ãã

       --re-interval
              --traditional ãæå®ããã¦ããã¨ãã¦ããæ£è¦è¡¨ç¾ä¸‐
              ã§ã¤ã³ã¿ã¼ãã«è¡¨ç¾ããµãã¼ããã¾ãã

   ã¢ã¯ã·ã§ã³
       ã¢ã¯ã·ã§ã³ã¯ããã¬ã¼ã¹ { 㨠} ã§å²ã¿ã¾ããã¢ã¯ã·ã§ã³ã¯é常ã®ä»£å¥ãæ¡ä»¶æã
       ã«ã¼ãæçãããªãã¾ããæ¼ç®åãå¶å¾¡æãå¥åºåæ㯠C è¨èªã¨ã»ã¼åæ§ã§ãã

   æ¼ç®å
       AWK ã§ã®æ¼ç®åããåªåé ä½ã®é«ããã®ããé ã«ç¤ºãã¾ãã

       (...)       ã°ã«ã¼ãåã

       $           ãã£ã¼ã«ãåç§ã

       ++ --       ã¤ã³ã¯ãªã¡ã³ãããã¯ãªã¡ã³ããåç½®ãå¾ç½®ãå¯è½ã

       ^           ã¹ãä¹ (** ãåæ§ã®æå³ã§ä½¿ç¨ã§ãããã¾ã **= 代å¥æ¼ç®åãåå¨ãã)ã

       + - !       åé ã®ãã©ã¹ããã¤ãã¹ãè«çå¦å®ã

       * / %       ä¹ç®ãé¤ç®ãå°ä½ã

       + -         å ç®ã¨æ¸ç®ã

       space       æååçµåã

       < >
       <= >=
       != ==       é常ã®é¢ä¿æ¼ç®åã

       ~ !~        æ£è¦è¡¨ç¾ããããå¦å®ã®ãããã 注æ: ~ 㨠!~ ã®å·¦è¾ºã«æ‐
                   £è¦è¡¨ç¾å®æ° (/foo/ç) ãç¨ãã¦ã¯ããã¾ãããæ‐
                   £è¦è¡¨ç¾å®æ°ã¯å³è¾ºã«ã®ã¿ç½®ããã¨ãã§ãã¾ããå¼ /foo/ ~ exp ã¯
                   (($0 ~ /foo/) ~ exp) ã¨ç価ã§ããã
                   ããã¯é常æå³ãããã®ã¨ã¯ç°ãªãã¾ãã

       in          éåã®ã¡ã³ãã

       &&          è«ç ANDã

       ||          è«ç ORã

       ?:          C è¨èªã®æ¡ä»¶å¼ã¨åæ§ã§ãã expr1 ? expr2 :
                   expr3ã®å½¢å¼ã§ä½¿ãã¾ãããã expr1 ãçãªãå¼ã®å¤ã¯ expr2
                   ã«ãªããããã§ãªããã° expr3 ã«ãªãã¾ãã expr2 ã expr3
                   ã®ãã¡çæ¹ã®ã¿ãè©ä¾¡ããã¾ãã

       = += -=
       *= /= %= ^= 代å¥ãçµ¶å¯¾ä»£å¥ (var = value) ã¨æ¼ç®åä»£å¥ (ä»ã®å½¢å¼)
                   ããµãã¼ãããã¦ãã¾ãã
   å¶å¾¡ã¹ãã¼ãã¡ã³ã
       å¶å¾¡ã¹ãã¼ãã¡ã³ãã¯ä»¥ä¸ã®ã¨ããã§ãã
              if (condition) statement [ else statement ]
              while (condition) statement
              do statement while (condition)
              for (expr1; expr2; expr3) statement
              for (var in array) statement
              break
              continue
              delete array[index]
              delete array
              exit [ expression ]
              { statements }
   å¥åºåã¹ãã¼ãã¡ã³ã
       å¥åºåã¹ãã¼ãã¡ã³ãã¯ä»¥ä¸ã®ã¨ããã§ãã
       close(file)        ãã¡ã¤ã« (ã¾ãã¯ãã¤ããä¸è¨åç§) ãã¯ãã¼ãºãã¾ãã
       getline            次ã®ã¬ã³ã¼ãã $0 ã«èªã¿è¾¼ã¿ã¾ãã NF, NR, FNR ãè¨‐
                          å®ããã¾ãã
       getline <file      ãã¡ã¤ã« file ãã次ã®ã¬ã³ã¼ãã $0 ã«èªã¿è¾¼ã¿ã¾ãã NF
                          ãè¨å®ããã¾ãã
       getline var        次ã®ã¬ã³ã¼ããå¤æ° var ã«èªã¿è¾¼ã¿ã¾ãã NR, FNR ãè¨‐
                          å®ããã¾ãã
       getline var <file  ãã¡ã¤ã« file ãã次ã®ã¬ã³ã¼ããå¤æ° var ã«èªã¿è¾¼ã¿ã¾ãã
       next               ç¾å¨ã®ã¬ã³ã¼ãã«å¯¾ããå¦çãçµäºãã次ã®ã¬ã³ã¼ããèª‐
                          ã¿è¾¼ã¿ãAWK ããã° ã©ã ã®æåã®ãã¿ã¼ã³ããå¦çãéå§ãã¾ãã C
                          è¨èªã® continue ã¨é¡ä¼¼ããæå³ãæã¡ã¾ãã
                          ãããå¥åãã¼ã¿ã®çµç«¯ã«éããå ´åã END ãããã¯ãå‐
                          å¨ããã°å®è¡ããã¾ãã
       nextfile           ç¾å¨ã®å¥åãã¡ã¤ã«ã«å¯¾ããå¦çãçµäºãã次ã®å¥åãã¡ã¤ã«ããã¬ã³ã¼ãã
                          èªã¿è¾¼ã¿ã¾ãã FILENAME 㨠ARGIND ãæ´æ°ããã FNR ã 1
                          ã«ãªã»ãããããAWK ããã°ã©ã ã®
                          æåã®ãã¿ã¼ã³ããå¦çãéå§ããã¾ããå¥åãã¼ã¿ã®çµç«¯ã«éããã¨ãã¯ã
                          ããåå¨ããã°ã END ãããã¯ãå®è¡ããã¾ãã 注:
                          以åã®ãã¼ã¸ã§ã³ã® gawk ã§ã¯ next file 㨠2
                          èªã§ä½¿ç¨ããã¦ãã¾ããããã®ç¨æ³ã¯ã¾ã èªèããã¾ããã è‐
                          ¦åã¡ãã»ã¼ã¸ãçãããã¾ãããæçµçã«ã¯ç¡ããªã表ç¾ã§ãã
       print              ç¾å¨ã®ã¬ã³ã¼ããåºåãã¾ãã åºåã¬ã³ã¼ã㯠ORS
                          å¤æ°ã®å¤ã«ã¦çµç«¯ããã¾ãã
       print expr-list    å¼ãåºåãã¾ããåå¼ã¯ OFS
                          ã®å¤ã§åºåããã¾ããåºåãããã¬ã³ã¼ãã®æå¾ã« 㯠ORS
                          ã®å¤ãä»å ããã¾ãã
       print expr-list >file
                          å¼ããã¡ã¤ã« file ã«åºåãã¾ããåå¼ã¯ OFS
                          ã®å¤ã§åºåããã¾ããåºåãããã¬ã³ã¼ãã® æå¾ã«ã¯ ORS
                          ã®å¤ãä»å ããã¾ãã
       printf fmt, expr-list
                          æ¸å¼ä»ãåºåã§ãã
       printf fmt, expr-list >file
                          ãã¡ã¤ã« file ã¸ã®æ¸å¼ä»ãåºåã§ãã
       system(cmd-line)   ã³ãã³ã cmd-line ãå®è¡ããçµäºã¹ãã¼ã¿ã¹ãè¿ãã¾ã (POSIX
                          ã«å¯¾å¿ããªã ã·ã¹ãã ã§ã¯ä½¿ç¨ã§ããªãå ´åãããã¾ã)ã
       fflush([file])     ãªã¼ãã³ããã¦ããåºåãã¡ã¤ã«ã¾ãã¯ãã¤ã file
                          ã«é¢é£ã¥ãããã¦ãããããã¡ããã©ãã·ã¥ãã¾ãã file
                          ãæå®ããªãã¨ãæ¨æºåºåããã©ãã·ã¥ããã¾ãã file ã空æå‐
                          åã®å ´åããªã¼ãã³ããã¦ãããã¹ã¦ã®ãã¡ã¤ã«ã¨ãã¤ãã®ãããã¡ã
                          ãã©ãã·ã¥ãã¾ãã
       ãã®ä»ã®å½¢å¼ã®ãªãã¤ã¬ã¯ãã¨ãã¦ä»¥ä¸ã®ãã®ãå©ç¨å¯è½ã§ãã print 㨠printf
       ã«å¯¾ãã¦ã >> file ãæå®ããã¨åºåã¯ãã¡ã¤ã« file ã«è¿½å ããã | command
       ã¯åºåããã¤ãã«å¯¾ãã¦è¡ãã¾ããåæ§ã«ã command| getline ã¯ã³ãã³ãã®åºåãã
       getline ãè¡ãªãã¾ãã getline ã¯ãã¡ã¤ã«çµç«¯ã§ã¯ 0 ããã¨ã©ã¼æã«ã¯ -1
       ãè¿ãã¾ãã
       注: ã«ã¼ãä¸ã§ getline ã¸ãã¤ãæ¸ãè¾¼ã¿ããå ´åã¾ã㯠print ã printf
       ãããã¤ãèªã¿åãããå ´åã ã³ãã³ãã®æ°ã¤ã³ã¹ã¿ã³ã¹ãä½æããããã« close()
       ã使ç¨ãããã¨ãå¿è¦ã§ãã ãã¤ãã EOF ãè¿ãã¨ãã§ããAWK ã¯èªåçã«ã¯ãã¤ããéãã¾ããã
   printf ã¹ãã¼ãã¡ã³ã
       AWK ã§ã® printf ã¹ãã¼ãã¡ã³ã㨠sprintf() é¢æ° (å¾è¿°åç§)
       ã¯ã以ä¸ã®å¤ææå®æ¸å¼ãåãä»ãã¾ãã
       %c     1 ã¤ã® ASCII æåã %c ã«å¯¾å¿ããå¼æ°ãæ°å¤ãªãããã®å¤ã ASCII
              ã³ã¼ãã¨ã¿ãªã ã¦æåã«å¤æãã¾ããããã§ãªããã°ãå¼æ°ã¯æååã§ããã¨è§£éããããã®
              1 æåç®ãåºåããã¾ãã
       %d
       %i     10 é²æ° (æ´æ°é¨å)ã
       %e
       %E     [-]d.dddddde[+-]dd ã¨ããå½¢å¼ã®æµ®åå°æ°ç¹æ°ã %E å½¢å¼ã§ã¯ e
              ã®ä»£ãã« E ã使ç¨ããã¾ãã

       %f     [-]ddd.dddddd ã¨ããå½¢å¼ã®æµ®åå°æ°ç¹æ°ã

       %g
       %G     %e 㨠%f ã®çãæ¹ã®å½¢å¼ã®æµ®åå°æ°ç¹æ°ãä½è¨ãª 0 ã¯çç¥ããã¾ãã %G
              å½¢å¼ã§ã¯ %e ã®ä»£ãã« %E ã使ç¨ãã¾ãã

       %o     符å·ãªãã® 8 é²æ° (æ´æ°)ã

       %u     符å·ãªãã® 10 é²æ° (æ´æ°)ã

       %s     æååã

       %x
       %X     符å·ãªãã® 16 é²æ° (æ´æ°)ã %X å½¢å¼ã§ã¯ã abcdef ã®ä»£ãã« ABCDEF
              ãç¨ãã¾ãã

       %%     åä¸ã®æå % ãå¼æ°ã¯ä½¿ç¨ãã¾ããã

       % ã¨ä¸è¨ã®å¶å¾¡æåã¨ã®éã«ãªãã·ã§ãã«ãªè¿½å ã®ãã©ã¡ã¼ã¿ãç½®ã
       ãã¨ãã§ãã¾ãã以ä¸ã«ãããã示ãã¾ãã

       -      å·¦å¯ãã

       ç©ºç½  æ°å¤å¤æã«ããã¦ãæ£ã®å¤ã®ãã¬ãã£ãã¯ã¹ã¯ç©ºç½ã¨ãªãã
              è² ã®å¤ã®ãã¬ãã£ãã¯ã¹ã¯ãã¤ãã¹è¨å·ã¨ãªãã¾ãã

       +      ãã©ã¹è¨å·ã¯å¹ä¿®æ£å (å¾è¿°) ã®åã«ä½¿ç¨ãã æ´å½¢ããããã¼ã¿ãæ‐
              £ã§ãã£ãã¨ãã¦ãã æ°å¤å¤æã«å¯¾ãã¦å¸¸ã«ç¬¦å·ãä»ãããã¨ãæ示ãã¾ãã +
              ã¯ç©ºç½ä¿®æ£åã«åªåãã¾ãã

       #      ããå¶å¾¡ã¬ã¿ã¼ã«å¯¾ãã¦ãå¥ã®å½¢å¼ãã使ç¨ãã¾ãã %o ã«å¯¾ãã¦ã¯åè¡ãã 0
              ãä¸ãã %x 㨠%X ã«å¯¾ãã¦ã¯é 0 ã®çµæã«å¯¾ãã¦åè¡ãã 0x 㨠0X
              ãä¸ãã¾ãã %e, %E, %f ã«å¯¾ãã¦ã¯çµæã«å¸¸ã«å°æ°ç¹ãå«ãã¾ãã %g, %G
              ã«å¯¾ãã¦ã¯çµæã®æ«å°¾ãã 0 ãåãé¤ãã¾ããã

       0      åé ã® 0 (ã¼ã) ã¯ãã©ã°ã¨ãã¦åä½ãã åºåã空ç½ã§ã¯ãªã 0
              ã§ããã£ã³ã°ãããã¨ã示ãã¾ãã ããã¯éæ°å¤ã®åºåæ¸å¼ã«å¯¾ãã¦ãé©ç¨ããã¾ãã
              ãã®ãã©ã°ãæå¹ãªã®ã¯ããã£ã¼ã«ãå¹ãå°åãããå¤ã®å¹ããåºãã¨ãã ãã§ãã

       width  ãã£ã¼ã«ããæå®ããå¹ width
              ã«ãªãããã«ããã£ã³ã°ããã¾ãããã£ã¼ã«ãã¯é常空ç½ã§ããã£ã³ã°ããã¾ãã 0
              ãã©ã°ã使ç¨ãããå ´åã«ã¯ 0 ã§ããã£ã³ã°ããã¾ãã

       .prec  å°åã«ããã¦ä½¿ç¨ãã精度ãæ°å¤ã§æå®ãã¾ãã %e, %E, %f
              ã®æ¸å¼ã«å¯¾ãã¦ã¯ãå°æ°ç¹ã®å³å´ã«å°åãããæ°åã®æ°ãæå®ãã¾ãã %g, %G
              ã®æ¸å¼ã«å¯¾ãã¦ã¯ãä»®æ°é¨ã®æ大æ°ãæå®ãã¾ãã %d, %o, %i, %u, %x, %X
              ã®æ¸å¼ã«å¯¾ãã¦ã¯ãå°åãããæ°åã®æå°æ°ãæå®ãã¾ãã æååã«å¯¾ãã¦ã¯ãå°å‐
              ãããæååããã¨ãã ãããæ大ã®æåæ°ãæå®ãã¾ãã

       ANSI C ã® printf() ã®åçãªå¹ width ã¨ç²¾åº¦ prec ã®æå®æ©è½ã使ç¨ã§ãã¾ãã
       å¹ ã¾ã㯠精度 ã®æå®é¨åã« * ãæå®ãããã¨ã§ããã®å¤ã printf ã¾ã㯠sprintf()
       ã¸ã®å¼æ°ã§æå®ã§ãã¾ãã

   ç¹æ®ãã¡ã¤ã«å
       print ã printf ã§æ¸ãè¾¼ã¿ã¨ãã§ãã getline ã§ãã¡ã¤ã«ããèªã¿åãã¨ãã§ãã
       å¥åºåãªãã¤ã¬ã¯ããè¡ãå ´åã gawk ã¯åé¨çãªç¹æ®ãªãã¡ã¤ã«åã解éãã¾ãã
       ãããã®ãã¡ã¤ã«åã«ããã親ããã»ã¹ (é常ã¯ã·ã§ã«ã§ã) ããåãç¶ãã
       ãªã¼ãã³ç¶æã®ãã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ãç¨ãã¦å¥åºåãè¡ã£ãããå®è¡ä¸ã® gawk ãã‐
       ã»ã¹ã«é¢ããæå ±ãå¾ããã¨ãã§ãã¾ãã ç¹æ®ãã¡ã¤ã«åã¯ä»¥ä¸ã®ã¨ããã§ãã

       /dev/pid    ç¾å¨ã®ããã»ã¹ã®ããã»ã¹ID (10 é²æ°ã§ãæå¾ã«æ¹è¡ãä»ãã¾ã) ã èª‐
                   ã¿è¾¼ããã¨ãã§ãã¾ãã

       /dev/ppid   ç¾å¨ã®ããã»ã¹ã®è¦ªã®ããã»ã¹ã®ããã»ã¹ID (10
                   é²æ°ã§ãæå¾ã«æ¹è¡ãä»ãã¾ã) ã èªã¿è¾¼ããã¨ãã§ãã¾ãã

       /dev/pgrpid ç¾å¨ã®ããã»ã¹ã®ããã»ã¹ã°ã«ã¼ã ID (10 é²æ°ã§ãæå¾ã«æ¹è¡ãä»ãã¾ã)
                   ãèªã¿è¾¼ããã¨ãã§ãã¾ãã

       /dev/user   ãã®ãã¡ã¤ã«ãèªããã¨ã§ãæ¹è¡ã§çµããåä¸ã®ã¬ã³ã¼ããå¾ããã¾ãã
                   åãã£ã¼ã«ãã¯ç©ºç½ã§åºåããã¦ãã¾ãã $1 㯠getuid(2)
                   ã·ã¹ãã ã³ã¼ã«ã®å¤ã $2 㯠geteuid(2) ã·ã¹ãã ã³ã¼ã«ã®å¤ã $3
                   㯠getgid(2) ã·ã¹ãã ã³ã¼ã«ã®å¤ã $4 㯠getegid(2)
                   ã·ã¹ãã ã³ã¼ã«ã®å¤ã§ãããããããã«ãã£ã¼ã«ããããã°ã ããã¯
                   getgroups(2) ã·ã¹ãã ã³ã¼ã«ãè¿ãã°ã«ã¼ã ID ã®ãªã¹ãã§ãã
                   å¨ã¦ã®ã·ã¹ãã ã§è¤æ°ã®ã°ã«ã¼ãããµãã¼ãããã¦ããããã§ã¯ããã¾ããã

       /dev/stdin  æ¨æºå¥åã

       /dev/stdout æ¨æºåºåã

       /dev/stderr æ¨æºã¨ã©ã¼åºåã

       /dev/fd/n   ãªã¼ãã³ããããã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ n ã«å¯¾å¿ãã¦ãããã¡ã¤ã«ã

       ã¨ã©ã¼ã¡ãã»ã¼ã¸ãåºåããã«ã¯ã以ä¸ã®æ¹æ³ã便å©ã§ãã

              print "You blew it!" > "/dev/stderr"

       ãããã®æ©è½ãç¡ãã£ããã次ã®ããã«ãããããªãã¨ããã§ãã

              print "You blew it!" | "cat 1>&2"

       ãããã®ãã¡ã¤ã«åã¯ãã³ãã³ãã©ã¤ã³ã®ãã¼ã¿ãã¡ã¤ã«æå®ã§ä½¿ããã¨ãã§ãã¾ãã

   æ°å¤é¢æ°
       AWK ã¯ä»¥ä¸ã®å®ç¾©æ¸ã¿æ°å¤é¢æ°ãæã£ã¦ãã¾ãã

       atan2(y, x)   y/x ã®éæ£æ¥ãã©ã¸ã¢ã³ã§ä¸ãã¾ãã

       cos(expr)     expr ã®ä½å¼¦ãã©ã¸ã¢ã³ã§ä¸ãã¾ãã

       exp(expr)     ææ°é¢æ°ã

       int(expr)     æ´æ°ã¸ã®åæ¨ã¦ã

       log(expr)     èªç¶å¯¾æ°ã

       rand()        0 ãã 1 ã®éã®ä¹±æ°ãä¸ãã¾ãã

       sin(expr)     expr ã®æ£å¼¦ãã©ã¸ã¢ã³ã§ä¸ãã¾ãã

       sqrt(expr)    å¹³æ¹æ ¹ã

       srand([expr]) expr
                     ã®å¤ãä¹±æ°çæé¢æ°ã®ç¨®ã¨ãã¦ç¨ãã¾ããå¼ãæå®ãããªãã£ãå ´åã¯ã
                     æå»ãç¨ãããã¾ããç´åã®ç¨®ã®å¤ãè¿ãã¾ãã

   æååé¢æ°
       gawk ã¯ä»¥ä¸ã®å®ç¾©æ¸ã¿æååé¢æ°ãæã£ã¦ãã¾ãã

       gensub(r, s, h [, t])   対象æåå t ããæ£è¦è¡¨ç¾ r ã®ããããæ¢ãã¾ãã h ã g
                               ã¾ã㯠G ã§éå§ããæååã®å ´åãããããã r ããã¹ã¦ s
                               ã«ç½®ãæãã¾ãã ããã§ãªãå ´åã h ã¯ä½çªç®ã® r
                               ã®ããããç½®ãæããã®ãã示ãã¾ãã t
                               ãä¸ããããªãå ´åã代ãã« $0 ã使ç¨ããã¾ãã ç½®æããã¹ã
                               s ã§ã¯ãã·ã¼ã±ã³ã¹ \n ãã ã n 㯠1 ãã 9
                               ã¾ã§ã®æ°åã使ç¨ãã¦ã n
                               çªç®ã«ãããããæ¬å¼§ä»ããµãå¼ã示ããã¨ãã§ãã¾ãã
                               ã·ã¼ã±ã³ã¹ \0 ã¯æå & ã¨åæ§ãããããããã‐
                               ã¹ãå¨ä½ã表ãã¾ãã sub() ã gsub() ã¨ã¯ç°ãªããä¿®æ‐
                               £ãããæååãé¢æ°ã®çµæã¨ãã¦è¿ããã åã®å¯¾è±¡ãã‐
                               ã¹ãã¯å¤æ´ãã ã¾ãã ã

       gsub(r, s [, t])        æåå t ä¸ã§æ£è¦è¡¨ç¾ r ã«ãããããé¨åããã¹ã¦ s
                               ã«ç½®æãã¾ããç½®æã®åæ°ãè¿ãã¾ãã t
                               ãæå®ããªãã£ãå ´å㯠$0 ãç¨ãããã¾ãã ç½®æããã¹ãã§ã¯ã
                               & ã¯å®éã«ãããããããã¹ãã§ç½®ãæãããã¾ãã \&
                               ã使ç¨ããã¨ãªãã©ã«ã® & ãå¾ããã¨ãã§ãã¾ãã sub(),
                               gsub(), gensub() ã«ããã &
                               ã¨ããã¯ã¹ã©ãã·ã¥ã«é¢ããå®å¨ãªè°è«ã¯ Effective AWK
                               Language Programming ãåç§ãã¦ãã ããã

       index(s, t)             æåå s ä¸ã«å«ã¾ããæåå t ã®ä½ç½®ãè¿ãã¾ãã t
                               ãå«ã¾ãã¦ããªãå ´å㯠0 ãè¿ãã¾ãã

       length([s])             æåå s ã®é·ããè¿ãã¾ãã s ãæå®ããªãã£ãå ´åã«ã¯ $0
                               ã®é·ããè¿ãã¾ãã

       match(s, r)             æåå s ä¸ã§æ£è¦è¡¨ç¾ r
                               ã«ãããããä½ç½®ãè¿ãã¾ãããããããªãå ´å㯠0 ã è¿ãã¾ãã
                               RSTART 㨠RLENGTH ã®å¤ãè¨å®ããã¾ãã

       split(s, a [, r])       æåå s ãæ£è¦è¡¨ç¾ r ãç¨ãã¦åå²ããéå a ã«æ ¼ç´ãã¾ãã
                               ãã£ã¼ã«ãæ°ãè¿ãã¾ãã r ãçç¥ãã ãå ´å㯠FS
                               ãç¨ãããã¾ããéå a ã®å容ã¯ãåå²åã«ã¯ãªã¢ããã¾ãã
                               åå²ã¯ãä¸è¿°ã®ãã£ã¼ã«ãåå²ã¨åãåä½ãè¡ãã¾ãã

       sprintf(fmt, expr-list) æ¸å¼ fmt ã«å¾ã£ã¦ exp-list
                               ãæ´å½¢è¡¨ç¤ºããçµæã®æååãè¿ãã¾ãã

       sub(r, s [, t])         gsub() ã¨ä¼¼ã¦ãã¾ãããæåã«ãããããæååã®ã¿ãç½®æããã¾ãã

       substr(s, i [, n])      æåå s ã® i æåç®ããå§ã¾ãæ大 n æåã®é¨åæååãè¿ãã¾ãã
                               n ãçç¥ãããå ´åã i æåç®ä»¥éã®é¨åæååãè¿ããã¾ãã

       tolower(str)            æåå str ãã³ãã¼ãã大æåããã¹ã¦å°æå‐
                               ã«å¤æãããã®ãè¿ãã¾ãã ã¢ã«ãã¡ãããã§ãªãæåã¯å¤åãã¾ããã

       toupper(str)            æåå str ãã³ãã¼ããå°æåããã¹ã¦å¤§æå‐
                               ã«å¤æãããã®ãè¿ãã¾ãã ã¢ã«ãã¡ãããã§ãªãæåã¯å¤åãã¾ããã

   æéé¢æ°
       ã¿ã¤ã ã¹ã¿ã³ããå«ãã ãã°ãã¡ã¤ã«ã®å¦ç㯠AWK ãã‐
       ã°ã©ã ã®ä¸»ãªä½¿ãéã®1ã¤ã§ãããã gawk ã¯ã¿ã¤ã ã¹ã¿ã³ããåãåºãããããã©ã¼ããã
       ããããã® 2 ã¤ã®é¢æ°ãæä¾ãã¾ãã

       systime() åºæºæç¹ããã®çµéç§æ°ãè¿ãã¾ã (POSIX ã·ã¹ãã ã§ã¯ãåºæºæç¹ã¯ UTC ã§
                 1970 å¹´ 1 æ 1 æ¥ 0:00 ã§ã)ã

       strftime([format [, timestamp]])
                 æ¸å¼ format ã«å¾ã£ã¦ timestamp ããã©ã¼ããããã¾ãã timestamp ã¯
                 systime() ãè¿ãå¤ã¨åãå½¢å¼ã§ãªããã°ãªãã¾ããã timestamp
                 ãçç¥ãããå ´åãç¾å¨ã®æ¥ä»ã使ç¨ããã¾ãã format ãçç¥ãããå ´åã
                 date(1) ãåºåã«ä½¿ç¨ãããã®ã¨åãããã©ã«ããã©ã¼ãããã使ç¨ããã¾ãã
                 å©ç¨å¯è½ãªãã©ã¼ãããã«ã¤ãã¦ã¯ãANSI C ã® strftime()
                 é¢æ°ã®ä»æ§ãåç§ãã¦ä¸ããããããªãã¯ãã¡ã¤ã³ãª strftime(3)
                 ã¨ãã®ããã¥ã¢ã«ãã¼ã¸ã gawk ã¨ã¨ãã«éå¸ããã¦ãã¾ããããã gawk
                 ãä½æããããã«ãã® strftime
                 ãç¨ããå ´åã¯ããã®ããã¥ã¢ã«ã«è¨è¿°ããã¦ããå¤ææ¸å¼ã gawk
                 ã§ãå©ç¨å¯è½ã§ãã

   æååå®æ°
       AWK ã§ã®æååå®æ°ã¯ãããã«ã¯ã©ã¼ã (") ã«çã¾ããæåã®åã§ãã æåååã§ã¯ãC
       è¨èªã®ããã«ããã¤ãã® ã¨ã¹ã±ã¼ãã·ã¼ã±ã³ã¹ ã使ãã¾ãã

       \\   ããã¯ã¹ã©ãã·ã¥ãã®ãã®ã

       \a   ãè¦åãæåãé常㯠ASCII BEL æåã§ãã

       \b   ããã¯ã¹ãã¼ã¹ã

       \f   æ¹ãã¼ã¸ (ãã©ã¼ã ãã£ã¼ã)ã

       \n   æ¹è¡ã

       \r   復帰 (ãã£ãªãã¸ãªã¿ã¼ã³)ã

       \t   æ°´å¹³ã¿ãã

       \v   åç´ã¿ãã

       \xhex digits
            \x ã«ç¶ã 16 é²æ°ã§è¡¨ç¾ãããæåãANSI C ã¨åæ§ã«ã \x ã«ç¶ããã¹ã¦ã® 16
            é²æ°å ã¯ã¨ã¹ã±ã¼ãã·ã¼ã±ã³ã¹ã®ä¸é¨ã§ããã¨ã¿ãªããã¾ãã
            (ãã®æ©è½ã«ããã³ãããã£ã«ããè¨èªãã¶ã¤ã³ãåããã¾ãã) ä¾ãã°ã"\x1B" 㯠ASCII
            ESC (ã¨ã¹ã±ã¼ã) æåã§ãã

       \ddd 1 æ¡ã 2 æ¡ã 3 æ¡ã® 8 é²æ°ã§è¡¨ç¾ãããæåãä¾ãã°ã "\033" 㯠ASCII ESC
            (ã¨ã¹ã±ã¼ã) æåã§ãã

       \c   æå c ãã®ãã®ã

       ã¨ã¹ã±ã¼ãã·ã¼ã±ã³ã¹ã¯æ£è¦è¡¨ç¾å®æ°åã§ãç¨ãããã¨ãã§ãã¾ã (ä¾ãã°ã
       /[ \t\f\n\r\v]/ ã¯ç©ºç½æåã«ããããã¾ã)ã

       äºæã¢ã¼ãã§ã¯ã8 é²ããã³ 16 é²ã®ã¨ã¹ã±ã¼ãã·ã¼ã±ã³ã¹ã§è¡¨ç¾ãããæåã¯ã æ‐
       £è¦è¡¨ç¾å®æ°ã¨ãã¦ä½¿ç¨ãããå ´åããªãã©ã«ã¨ãã¦æ±ããã¾ãã ããããã /a\52b/ ã¯
       /a\*b/ ã¨ç価ã§ãã

é¢æ°
       AWK ã§ã¯é¢æ°ã以ä¸ã®ããã«ãã¦å®ç¾©ãã¾ãã

              function name(parameter list) { statements }

       é¢æ°ã¯ããã¿ã¼ã³ã¾ãã¯ã¢ã¯ã·ã§ã³ã®å¼ããå¼ã³åºãããã¨ãã«å®è¡ããã¾ãã
       é¢æ°å¼ã³åºãã«ããã¦ä¸ããããå®å¼æ°ããé¢æ°å®£è¨ã«ãããä»®å¼æ°ã« åã渡ããã¾ãã
       ãã®ã¨ãéåã®å ´åã¯åç§æ¸¡ããè¡ãããä»ã®å¤æ°ã®å ´åã¯å¤æ¸¡ãã§è¡ããã¾ãã

       åã AWK ã«é¢æ°ã¯åãã£ã¦ãã¾ããã§ããã®ã§ãå±æå¤æ°ã®æ©æ§ã¯ãã¾ã
       ã¹ãã¼ãã§ã¯ããã¾ããã
       å±æå¤æ°ã¯å¼æ°ãªã¹ãã®ä½åãªå¼æ°ã¨ãã¦å®£è¨ãã¾ããå±æå¤æ°ã¨é¢
       æ°å¼æ°ãåºå¥ãããããä½åãªç©ºç½ã§åºåãã®ãæ£ç¿ã§ããä¾ãã°ã以ä¸ã®ã ãã«ãã¾ãã

              function  f(p, q,     a, b)   # a & b ã¯å±æå¤æ°
              {
                   ...
              }

              /abc/     { ... ; f(1, 2) ; ... }

       é¢æ°å¼ã³åºãã«ãããå·¦æ¬å¼§ã¯ã空ç½ãçã¾ãã«é¢æ°åã®ç´å¾ã« ç½®ããªããã°ããã¾ããã
       ããã¯ãæååçµåæ¼ç®åã¨ã®ææ§ããçããããªãããã«å¿è¦ã§ãã
       ãã®å¶éã¯ãä¸è¿°ã®çµã¿è¾¼ã¿é¢æ°ã«ã¯ãã¦ã¯ã¾ãã¾ããã

       é¢æ°ã¯ãä»ã®é¢æ°ãå¼ã³åºããããèªåèªèº«ãå帰çã«å¼ã³åºããã¨ãã§ãã¾ãã
       å±æå¤æ°ã¨ãã¦ç¨ããããé¢æ°å¼æ°ã¯ãé¢æ°èµ·åæã«ç©ºæååããã³ 0 ã«åæåããã¾ãã

       é¢æ°ããå¤ãè¿ãã«ã¯ return expr ã使ç¨ãã¦ãã ããã
       å¤ãæå®ããªãå ´åãã¾ãã¯é¢æ°ã®çµããã “è½ã¡ã” (訳注:
       é¢æ°ãéãããã¬ã¼ã¹ã«å°éãã) ãã¨ã«ããé¢æ°ããæ»ãå ´åã å¤ã¯æªå®ç¾©ã§ãã

       --lint ãæå®ãããã¨ãã gawk
       ã¯å®è¡æã§ã¯ãªããã¼ãºæã«æªå®ç¾©é¢æ°ã®å¼ã³åºãã«é¢ãã¦è¦åãã¾ãã
       å®è¡æã®æªå®ç¾©é¢æ°ã®å¼ã³åºãã¯è´å½çãªã¨ã©ã¼ã¨ãªãã¾ãã

       function ã®ãããã« func ãç¨ãããã¨ãã§ãã¾ãã

使ç¨ä¾
       “/etc/passwd” ããå¨ã¦ã¼ã¶ã®ãã°ã¤ã³åãåãåºããã½ã¼ããã¦åºåãã¾ãã

            BEGIN     { FS = ":" }
                 { print $1 | "sort" }

       ãã¡ã¤ã«ã®è¡æ°ãæ°ããã

                 { nlines++ }
            END  { print nlines }

       è¡çªå·ãã¤ããã

            { print FNR, $0 }

       å¨ãã¡ã¤ã«ãéããè¡çªå·ãã¤ããã

            { print NR, $0 }

é¢é£é ç®
       egrep(1), getpid(2), getppid(2), getpgrp(2), getuid(2), geteuid(2),
       getgid(2), getegid(2), getgroups(2)

       The AWK Programming Language, Alfred V. Aho, Brian W. Kernighan, Peter
       J. Weinberger, Addison-Wesley, 1988. ISBN 0-201-07981-X.

       Effective AWK Language Programming, Edition 1.0, published by the Free
       Software Foundation, 1995.

POSIX äºæ
       gawk ã¯ææ°çã® UNIX awk ã¨ã®äºææ§ã ãã§ãªããPOSIX
       æ¨æºã¨ã®äºææ§ã追æ±ãã¦ãã¾ãã ãã®ãã gawk
       ã«ã¯ä»¥ä¸ã®ãããªæ©è½ãåãå¥ãããã¦ãã¾ãã ãããã®æ©è½ã¯ AWK
       æ¬ã«ã¯è¿°ã¹ããã¦ãã¾ãããã Bell Labs ããã³ POSIX æ¨æºã® awk ãæãã¦ããæ©è½ã§ãã

       ããã°ã©ã å®è¡åã«å¤æ°ä»£å¥ãè¡ãªã -v ãªãã·ã§ã³ã¯æ°ããç©ã§ãã AWK
       æ¬ã«ããã°ãã³ãã³ãã©ã¤ã³ã§æå®ãããå¤æ°ä»£å¥ã¯ awk
       ãå¼æ°ããã¡ã¤ã«åã¨ãã¦ãªã¼ãã³ããéã«è¡ãªããããã¨ã«ãªãã¾ããã¤ã¾ã ãã㯠BEGIN ãã‐
       ãã¯ã®å®è¡å¾ã§ããããããªããåæã®é ã®å®è£ã§ã¯ãå¼æ°ã®ä¸ã§ãã¡ã¤ã«åã«
       åç«ã£ã¦å¤æ°ä»£å¥ãæå®ããã¦ããå ´åã«ã¯ã代å¥ã¯ BEGIN ãããã¯å®è¡ã® åã«
       è¡ããã¦ãã¾ãããããã¦ã¢ããªã±ã¼ã·ã§ã³ã¯ããã®ãä»æ§ãã«ä¾åãã ããã«ãªãã¾ããã awk
       ããã®ããã¥ã¡ã³ãã«åãããã«ç´ãããæãæã®åä½ã«ä¾åãã¦ãã
       ã¢ããªã±ã¼ã·ã§ã³ã®ä¾¿å®ãå³ãããã«ãã®ãªãã·ã§ã³ãå ãããã¾ããã (ãã®ä»æ§ã¯ AT&T
       ããã³ GNU ã®éçºèéã«ãã£ã¦åæããã¾ããã)

       ç¬èªæ©è½ã®ããã® -W ãªãã·ã§ã³ã¯ POSIX æ¨æºã«å¾ã£ããã®ã§ãã

       å¼æ°ã®åã«ç¹å¥ãªãªãã·ã§ã³ “--” ãæå®ããã¨ã gawk
       ã¯ããããªãã·ã§ã³ã®çµããã§ããã¨è§£éãã¾ãã
       äºæã¢ã¼ãã«ããã¦ã¯æªå®ç¾©ãªãã·ã§ã³ã¯è¦åãåºåããããã以å¤ã®ãã®ã¯ ç¡è¦ããã¾ãã
       é常ã®å®è¡ã«ããã¦ã¯æ®ãã®å¼æ°ã¯ AWK ããã°ã©ã ã«å¼ã渡ããã¾ãã

       AWK æ¬ã¯ srand() ã®è¿ãå¤ãå®ç¾©ãã¦ãã¾ããã POSIX æ¨æº
       ã§ã¯ããã®é¢æ°ã使ã£ã¦ãã種ãè¿ãã ä¹±æ°ã·ã¼ã±ã³ã¹ã追跡ã§ããããã«ãã¦ãã¾ãã
       ãããã£ã¦ gawk ã«ããã srand() ãç¾å¨ã®ç¨®ãè¿ãããã«ãã¦ããã¾ãã

       ãã®ä»ã«ã以ä¸ã®ãããªæ°æ©è½ãããã¾ãã -f ãªãã·ã§ã³ã®è¤æ°åä½¿ç¨ (MKS
       awkã«å£ãã¾ãã); ENVIRON éå; ã¨ã¹ã±ã¼ãã·ã¼ã±ã³ã¹ \a 㨠\v ( gawk
       ã§æåã«å®è£ãããAT&T ã® awk ã«ãã£ã¼ãããã¯ããã¾ãã); çµã¿è¾¼ã¿é¢æ° tolower()
       㨠toupper() (AT&T ã«å£ãã¾ãã); printf ã«ããã ANSI C å¤ææå® (AT&T
       çã§æåã«å®è£ããã¾ãã)ã

GNU æ¡å¼µ
       gawk 㯠POSIX awk ã«å¯¾ãã¦å¤ãã®æ¡å¼µãè¡ãªããã¦ãã¾ãã
       ãã®ç¯ã§ã¯ãããã«ã¤ãã¦è§£èª¬ãã¾ãã --traditional ãªãã·ã§ã³ä»ã㧠gawk
       ãèµ·åãããã¨ã«ãã£ã¦ã ããã§è¿°ã¹ããã¦ããæ¡å¼µæ©è½ããã¹ã¦ç¦æ¢ãããã¨ãã§ãã¾ãã

       gawk ãæã¤ä»¥ä¸ã®æ©è½ã¯ POSIX awk ã§ã¯ä½¿ç¨ã§ãã¾ããã

              · ã¨ã¹ã±ã¼ãã·ã¼ã±ã³ã¹ \x ã( --posix ã§ææ¢ã§ãã¾ãã)

              · fflush() é¢æ°ã( --posix ã§ææ¢ã§ãã¾ãã)

              · systime(), strftime(), gensub() ã®åé¢æ°ã

              · å¥åºåãªãã¤ã¬ã¯ãã§å©ç¨å¯è½ãªç¹æ®ãã¡ã¤ã«åã¯ç解ããã¾ããã

              · å¤æ° ARGIND, ERRNO, RT ã¯ç¹æ®å¤æ°ã§ã¯ããã¾ããã

              · å¤æ° IGNORECASE ã¨ãã®å¯ä½ç¨ã¯å©ç¨ã§ãã¾ããã

              · å¤æ° FIELDWIDTHS ã¨åºå®é·ãã£ã¼ã«ãåå²ã

              · RS ã®æ£è¦è¡¨ç¾ã¨ãã¦ã®ä½¿ç¨ã

              · FS ã«ç©ºæååãè¨å®ãããã¨ã«ããåæåãåãåºãè½åã¨ã split() ã® 3
                çªç®ã®å¼æ°ã

              · -f ãªãã·ã§ã³ã§æå®ããããã¡ã¤ã«åã«ã¤ãã¦ãã¹æ¤ç´¢ãè¡ããªããã¨ã
                ãã£ã¦ãç°å¢å¤æ° AWKPATH ã¯ç¹æ®ãªå¤æ°ã§ã¯ããã¾ããã

              · ç¾å¨ã®å¥åãã¡ã¤ã«ã«å¯¾ããå¦çãçµããããããã«ä½¿ç¨ããã nextfile ã

              · éåå¨ä½ãåé¤ããããã«ä½¿ç¨ããã delete éå ã

       AWK æ¬ã¯é¢æ° close() ã®è¿ãå¤ãå®ç¾©ãã¦ãã¾ããã gawk ã® close()
       ã¯ããã¡ã¤ã«ããã¤ããã¯ãã¼ãºããéã«å¼ã³åºã fclose(3) ã pclose(3)ã
       ããã®è¿ãå¤ãè¿ãã¾ãã

       ãªãã·ã§ã³ --traditional ä»ã㧠gawk ãèµ·åã -F ãªãã·ã§ã³ã¸ã®å¼æ° fs ã¨ãã¦
       “t” ãä¸ããå ´åã«ã FS ã®å¤ã¯ã¿ãæåã«è¨å®ããã¾ãã gawk -F\t ...
       ã¨ã¿ã¤ããã¦ããã·ã§ã«ãåã« “t” ãã¯ã©ã¼ãããã®ã§ã“\t” 㯠-F
       ãªãã·ã§ã³ã«æ¸¡ããã¾ããã ããã¯å°ãè¦è¦ããç¹æ®äºä¾ã§ãã®ã§ãããã©ã«ãã®åä½ã¨ãã¦ã¯
       æ¡ç¨ããã¦ãã¾ããã --posix ãæå®ããå ´åã«ãããã®åä½ã¯è¡ãªããã¾ããã ã¿ãæå‐
       ããã£ã¼ã«ãã»ãã¬ã¼ã¿ã¨ãã¦ä½¿ç¨ãããå ´åã«ã¯ã ã¯ã©ã¼ãã使ç¨ããã®ãæè¯ã§ã: gawk
       -F'\t' ....

æ´å²çæ©è½
       gawk ã¯æ´ä»£ã® AWK ã®å®è£ã«ãã£ã 2 ã¤ã®æ©è½ãåãã¦ãã¾ãã 1
       ã¤ãã¨ãã¦ãçµã¿è¾¼ã¿é¢æ° length()
       ã¯å¼æ°ç¡ãã§å¼ã³åºããã ãã§ãªããããã«æ¬å¼§ç¡ãã§ãå¼ã³åºãã¾ã!  ãããã£ã¦

              a = length     # Holy Algol 60, Batman!

       ã¯ä»¥ä¸ã®2ä¾ã¨åãã§ãã

              a = length()
              a = length($0)

       POSIX æ¨æºã§ã¯ãã®æ©è½ã¯ “deprecated” ã¨æ³¨ææ¸ãããã¦ããã gawk
       ã§ã¯ã³ãã³ãã©ã¤ã³ã§ --lint ãæå®ããå ´åã«ããã®æ©è½ã®ä½¿ç¨ã«å¯¾ãã¦è‐
       ¦åãåºåãã¾ãã

       ãã 1 ã¤ã¯ã while, for, do ã«ã¼ãæ¬ä½ã®å¤ã§ã continue, break
       ã¹ãã¼ãã¡ã³ãã使ç¨ã§ããã¨ããæ©è½ã§ãã ä¼çµ±ç㪠AWK
       ã®å®è£ã§ã¯ããã®ããã«ä½¿ç¨ãã continue ã¹ãã¼ãã¡ã³ãã next ã¹ãã¼ãã¡ã³ãã¨ç‐
       価ãªãã®ã¨ãã¦æ±ã£ã¦ãã¾ããã gawk ã§ã¯ --traditional
       ãæå®ãããå ´åã«ããã®æ©è½ã使ããã¨ãã§ãã¾ãã

ç°å¢å¤æ°
       ç°å¢ã« POSIXLY_CORRECT ãåå¨ããå ´åã«ã¯ã gawk ã¯ã³ãã³ãã©ã¤ã³ã§ --posix
       ãæå®ããã¦ããæã¨å¨ãåãåä½ããã¾ãã ãã®ã¨ã --lint ãæå®ããã¦ãã㨠gawk
       ã¯ãã®ä½ç¨ã«ã¤ãã¦ã®è¦åã¡ãã»ã¼ã¸ãåºåãã¾ãã

       AWKPATH ç°å¢å¤æ°ã使ç¨ãã¦ã gawk ã -f ããã³ --file
       ãªãã·ã§ã³ã§æå®ããããã¡ã¤ã«åãæ¤ç´¢ãããã£ã¬ã¯ããªãæå®ã§ãã¾ãã

ãã°
       ã³ãã³ãã©ã¤ã³ã§ã®å¤æ°ä»£å¥æ©è½ã使ç¨ããã«ã¯ãå¤æ°ã¸ã®ä»£å¥ãç´æ¥
       ã³ãã³ãã©ã¤ã³ã«æ¸ãã°ããã -F ãªãã·ã§ã³ãã¤ããå¿è¦ã¯ããã¾ããã ãã®ãªãã·ã§ã³ã¯æã®
       awk ã¨ã®äºææ§ã®ããã ãã«æ®ããã¦ãã¾ãã

       ãã¡ã¤ã« /dev/fd ããã³ /dev/stdin, /dev/stdout, /dev/stderr
       ãå®éã«ãµãã¼ããã¦ããã·ã¹ãã ã§ã® gawk
       ããã¯ããããããªãã·ã¹ãã ã¨ã¯éã£ãåºåãå¾ãããããããã¾ããã gawk
       ã¯ãããã®ãã¡ã¤ã«ãåé¨ã§è§£éããéã«æ¨æºåºåã¸ã®åºåã /dev/stdout
       ã¸ã®åºåã¨åæããã¾ããããããã®ãã¡ã¤ã«ãæã¤ã·ã¹ãã ã§ã¯
       åºåã¯ããããç°ãªããã¡ã¤ã«ã¸åãããã¾ãã å©ç¨èã®æ¹ã§æ°ãä»ããããã«ãã¦ãã ãã (Caveat
       Emptor)ã

       ææ³çã«èª¤ã£ãåä¸æåããã°ã©ã ã¯ãã¼ãºã¹ã¿ãã¯ã溢ããããå¾åãããã
       ã¾ã£ããåãããªãã¡ãã»ã¼ã¸ãçæããå¾åã«ããã¾ãã ãã®ãããªããã°ã©ã ã®è¨ºæ‐
       ã¯é©ãã¹ããã¨ã«ä¸è¬ã«é£ããã 診æã®åªåã¯ã¾ã£ããç¡æå³ã«ãªãã¾ãã

ãã¼ã¸ã§ã³æå ±
       ãã®ããã¥ã¢ã«ã¯ gawk ãã¼ã¸ã§ã³ 3.0.6 ã«ã¤ãã¦è¨è¼ãã¦ãã¾ãã

ä½è
       UNIX awk ã®æåã®ãã¼ã¸ã§ã³ã¯ãAT&T Bell Labs ã® Alfred Aho 㨠Peter
       Weinberger ããã³ Brian Kernighan ã«ãã£ã¦è¨è¨ãå®è£ããã¾ããã Brian Kernighan
       ã¯ãã®ä¿å®ã¨æ¹è¯ãç¶ãã¦ãã¾ãã

       Free Software Foundation ã® Paul Rubin 㨠Jay Fenlason ããSeventh
       Edition UNIX ã§éå¸ãããæåã®ãã¼ã¸ã§ã³ã® awk ã¨äºææ§ãæã¤ããã« gawk ãæ¸ãã¾ããã
       John Woods ã¯æ°ãã®ãã°ä¿®æ£ãéã£ã¦ä¸ããã¾ããã David Trueman ã¯ãArnold
       Robbins ãéã£ã¦ä¸ãã£ãå容ããã¨ã«ã gawk ãæ°ãã¼ã¸ã§ã³ã® UNIX awk
       äºæã«ãã¾ããã

       DOS ã¸ã®æåã®ç§»æ¤ã¯ Conrad Kwok 㨠Scott Garfinkle ã«ãã£ã¦ è¡ãªããã¾ããã
       ç¾å¨ã¯ Scott Deifik ã DOS çã®ä¿å®ããã¦ãã¾ãã Pat Rankin 㯠VMS
       ã¸ã®ç§»æ¤ãè¡ãªããMichal Jaegermann 㯠Atari ST ã¸ã® 移æ¤ãè¡ãªãã¾ããã
       OS/2 ã¸ã®ç§»æ¤ã¯ Kai Uwe Rommel ã Darrel Hankerson ã®å©ããåãã¦
       è¡ãªãã¾ããã Fred Fish ã Amiga ãµãã¼ãã®æä¾ãè¡ãã¾ããã

ãã°ã¬ãã¼ã
       gawk ã®ãã°ãè¦ä»ããããé»åã¡ã¼ã«ã bug-gawk@gnu.org å®ã«éã£ã¦ãã ããã é»å‐
       ã¡ã¼ã«ã«ã¯ããªãã¬ã¼ãã£ã³ã°ã·ã¹ãã ã¨ãã®ãªãã¸ã§ã³ã gawk
       ã®ãªãã¸ã§ã³ãã³ã³ãã¤ã«ã«ä½¿ç¨ãã C ã³ã³ãã¤ã©ã
       åé¡ãåç¾ããã§ããã ãå°ããªãã¹ãããã°ã©ã ã¨ãã¼ã¿ãè¨è¿°ãã¦ãã ããã

       ãã°ã¬ãã¼ããéãåã« 2 ã¤ã®ãã¨ãè¡ã£ã¦ãã ããã 第 1 ã«ãææ°ã® gawk
       ã使ç¨ããã¦ãããã¨ã確èªãã¦ãã ããã å¤ãã® (é常微å¦ãª)
       ãã°ãåãã®ãªãªã¼ã¹ã§ä¿®æ£ããã¦ãã¾ãã®ã§ã
       ã使ç¨ã®ãã®ãå¤ãå ´åã«ã¯åé¡ã¯æ¢ã«è§£æ±ºããã¦ããããããã¾ããã 第 2
       ã«ããã®ããã¥ã¢ã«ãã¼ã¸ã¨ãªãã¡ã¬ã³ã¹ããã¥ã¢ã«ã注ææ·±ãèªã¿ã
       ããªãããã°ã ã¨æããã®ã確ãã«ãã°ã§ããã
       大ããå¤ãã£ãè¨èªä»æ§ã§ã¯ãªããã¨ã確èªãã¦ãã ããã

       ãã°ã¬ãã¼ãã comp.lang.awk ã«æ稿ãããã¨ã ãã¯ããªãã§ãã ããã gawk
       ã®éçºèéã¯æããã®ãã¥ã¼ã¹ã°ã«ã¼ããèªã¿ã¾ããã
       ãã°ã¬ãã¼ãããã®ãã¥ã¼ã¹ã°ã«ã¼ãã«æ稿ãã¦ã ãã°ã¬ãã¼ãã¨ãã¦ä¿¡é ¼æ§ãããã¾ããã
       ä¸è¨ã®ã¢ãã¬ã¹ã¸ã®é»åã¡ã¼ã«ã§ãé¡ããã¾ãã

è¬è¾
       Bell Labs ã® Brian Kernighan ã¯ãã¹ãããã³ãããã°ã®éãè²´éãªå©åã
       æä¾ãã¦ä¸ããã¾ããã æè¬è´ãã¾ãã

COPYING PERMISSIONS
       Copyright © 1996-2000 Free Software Foundation, Inc.

       Permission is granted to make and distribute verbatim copies of this
       manual page provided the copyright notice and this permission notice
       are preserved on all copies.

       Permission is granted to copy and distribute modified versions of this
       manual page under the conditions for verbatim copying, provided that
       the entire resulting derived work is distributed under the terms of a
       permission notice identical to this one.

       Permission is granted to copy and distribute translations of this
       manual page into another language, under the above conditions for
       modified versions, except that this permission notice may be stated in
       a translation approved by the Foundation.



Free Software Foundation          May 17 2000                          GAWK(1)