AWK(オーク)を使ったワンライナーはとても強力で簡便なテキスト処理を可能とします.最近は,Perl や Ruby でもほとんど同様のことができ,取って代わられて久しいですが未だにその枯れ力といいますか,汎用性に関しては群を抜いているように思います. また,awk とは AWK の処理系のことを指しています. 一般に元祖 awk と呼ばれる処理系が最初と言われています.実際はわかりませんが,絶滅種の如く見かけることはなく,その文法などに関しても関数定義などの基本的な部分が抜けていたので New awk(通称,nawk)として多少の文法が追加された処理系が,その流派を継いでいます. そして GNU プロジェクトによって大幅強化された awk が gawk です. よく見かけるのは,gawk か nawk のどっちかだと思います. 現在,Linux では標準で gawk が,OS X では 2
![実用 awk ワンライナー - Qiita](https://cdn-ak-scissors.b.st-hatena.com/image/square/c62d4b9b38b24590aa7609c1053c8d45abfcc015/height=288;version=1;width=512/https%3A%2F%2Fqiita-user-contents.imgix.net%2Fhttps%253A%252F%252Fqiita-user-contents.imgix.net%252Fhttps%25253A%25252F%25252Fqiita-user-contents.imgix.net%25252Fhttps%2525253A%2525252F%2525252Fcdn.qiita.com%2525252Fassets%2525252Fpublic%2525252Farticle-ogp-background-9f5428127621718a910c8b63951390ad.png%25253Fixlib%25253Drb-4.0.0%252526w%25253D1200%252526mark%25253Dhttps%2525253A%2525252F%2525252Fqiita-user-contents.imgix.net%2525252F~text%2525253Fixlib%2525253Drb-4.0.0%25252526w%2525253D897%25252526txt64%2525253D5a6f55SoIGF3ayDjg6_jg7Pjg6njgqTjg4rjg7w%25252526txt-color%2525253D%2525252523212121%25252526txt-font%2525253DHiragino%2525252520Sans%2525252520W6%25252526txt-size%2525253D56%25252526txt-clip%2525253Dellipsis%25252526txt-align%2525253Dleft%252525252Ctop%25252526txt-pad%2525253D0%25252526s%2525253D2969d0e1b703f7faf50b528fc67cb9d1%252526mark-x%25253D152%252526mark-y%25253D122%252526s%25253De92d301cbc7ddfba05a976c59dacc58f%253Fixlib%253Drb-4.0.0%2526w%253D1200%2526mark%253Dhttps%25253A%25252F%25252Fqiita-user-contents.imgix.net%25252Fhttps%2525253A%2525252F%2525252Fqiita-image-store.s3.amazonaws.com%2525252F0%2525252F29787%2525252Fprofile-images%2525252F1473685392%25253Fixlib%25253Drb-4.0.0%252526w%25253D64%252526h%25253D64%252526mask%25253Dellipse%252526fm%25253Dpng%252526bg%25253Dfff%252526s%25253D155b8a7dcf4e437ae8fcdddb9030ad56%2526mark-x%253D152%2526mark-y%253D486%2526s%253Dc7e6a17756e7c4b983de4ec6476b3a70%3Fixlib%3Drb-4.0.0%26w%3D1200%26mark%3Dhttps%253A%252F%252Fqiita-user-contents.imgix.net%252F~text%253Fixlib%253Drb-4.0.0%2526w%253D616%2526txt64%253DYjRiNHIwNw%2526txt-color%253D%252523212121%2526txt-font%253DHiragino%252520Sans%252520W6%2526txt-size%253D36%2526txt-align%253Dleft%25252Ctop%2526txt-pad%253D0%2526s%253Da8f3df7d25021605063c99cc42b5a2c1%26mark-x%3D232%26mark-y%3D500%26s%3D46dd66446528863738b6a962b3a5d623)