Help us understand the problem. What is going on with this article?

GNU AWK 5.0を早速インストールしてみる

awk.png

背景

GNU AWK 5.0がリリース。8年ぶりのメジャーバージョンアップをしたというニュースを見て早速使ってみようと思いとりあえず使う段階まで行ったのでメモ的に残します。

GNU AWK 5.0がリリース。8年ぶりのメジャーバージョンアップ。正規表現ライブラリがGLIBCからGNULIBへ移行、名前空間が実装

ビルド手順

①ソースを入手 解凍
下記から自分の使いたいバージョンを持ってこれる
今回は5.0.0.を使用
ftp://ftp.gnu.org/gnu/gawk

$ wget ftp://ftp.gnu.org/gnu/gawk/gawk-5.0.0.tar.gz

$ cd gawk-5.0.0/

$ tar -zxvf gawk-5.0.0.tar.gz

②ビルド
configure⇒make⇒make installの流れでビルドからインストールまでできます。
※ 当然だがmake installだけ「root権」が必要

$ ./configure

$ make clean ; make

試す

5.0.0になってることを確認しました。

root@OPST-N394:~/work2/gawk-5.0.0# ./gawk --version
GNU Awk 5.0.0, API: 2.0
Copyright (C) 1989, 1991-2019 Free Software Foundation.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.

変更点など

ソースと一緒に入っているNEWSに細かい変更点などが記載されています。
名前空間の実装がとても気になったので近々追記します。

11. Namespaces have been implemented! See the manual.  One consequence of this
    is that files included with -i, read with -f, and command line program
    segments must all be self-contained syntactic units. E.g., you can no
    longer do something like this:

        gawk -e 'BEGIN {' -e 'print "hello" }'

参考リンク

GNU AWK 5.0がリリース。8年ぶりのメジャーバージョンアップ。正規表現ライブラリがGLIBCからGNULIBへ移行、名前空間が実装
GNU awk 5.0.0がリリース - 名前空間が実装されたメジャーバージョンアップ版

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした