Skip to Content
プログラミング言語AWK 第2版
book

プログラミング言語AWK 第2版

by Alfred V. Aho, Brian W. Kernighan, Peter J. Weinberger, 千住 治郎
May 2024
Intermediate to advanced
276 pages
3h 51m
Japanese
O'Reilly Japan, Inc.
Content preview from プログラミング言語AWK 第2版

9章あとがき

ここまでで読者は Awk を使いこなすパワーユーザに成長しただろう。少なくとも戸惑うばかりの奧手な初心者 (awkward beginner) ではないだろう。本書で取り上げた例から学び、自身でもコードを書くうちに、なぜ Awk プログラムはこうなっているのかと興味が湧き、もっと良いものにしたいと考えたこともあるかもしれない。

本章ではまず Awk プログラミング言語の歴史を簡単に述べ、その長所、短所について述べる。次に Awk プログラムの性能を探求し、大きくなりすぎたプログラムの形を変える方策をいくつか提示する。

9.1プログラミング言語としてのAwk

Awk の開発を始めたのは 1977 年 (昭和 52 年) のことだった。当時の Unix プログラムで正規表現を使用できたのは、テキストファイルのみを検索する grepsed しかなく、また、一致した行はそのまま出力するか、sed で置換できるだけだった。フィールドも数値演算もできなかったのだ。当時の著者陣の目標は、フィールドを認識するパターンスキャン言語だったと記憶している。フィールドに一致するパターンと、フィールドを処理できるアクションだ。当初は、プログラムの入力検証や、レポート生成、他のプログラムへの入力を目的に、データを変形させられれば十分だった。

1977 年当時のバージョンは、「1章 Awk チュートリアル」に挙げたようなごく短いプログラム用の言語設計にすぎず、2、3 の組み込み変数 / 関数しかなかった。さらに言えば、ほとんど説明がなくとも身近な同僚が使えれば良い程度の設計だったのだ。正規表現はすでに慣れていた egrep からの流用だし、また他の文や文法などはやはりすでに使用していた C 言語からの流用だ。ちなみに ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

プログラミングRust 第2版

プログラミングRust 第2版

Jim Blandy, Jason Orendorff, Leonora F. S. Tindall, 中田 秀基
仕事ではじめる機械学習 第2版

仕事ではじめる機械学習 第2版

有賀 康顕, 中山 心太, 西林 孝
詳説 イーサネット 第2版

詳説 イーサネット 第2版

Charles E. Spurgeon, Joann Zimmerman, 三浦 史光, 豊沢 聡
Linuxカーネルプログラミング 第2版

Linuxカーネルプログラミング 第2版

Kaiwan N. Billimoria, 武内 覚, 大岩 尚宏

Publisher Resources

ISBN: 9784814400706Publisher Website