参考文献
configure, make, make install とは何か【 which 】コマンド――実行コマンドのフルパスを表示する
GNU awk 5.0.0がリリース - 名前空間が実装されたメジャーバージョンアップ版
https://qiita.com/ryuichi1208/items/fe625fba0afe0ec46789
Gawk 5.0.0 released!
実行例
コード表示
[oracle@centos rr]$ gawk --version | head -n 1
GNU Awk 4.0.2
[oracle@centos ff]$ ll
合計 0
[oracle@centos ff]$ curl -LO ftp://ftp.gnu.org/gnu/gawk/gawk-5.0.0.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5628k 100 5628k 0 0 222k 0 0:00:25 0:00:25 --:--:-- 303k
[oracle@centos ff]$ ll
合計 5632
-rw-r--r--. 1 oracle docker 5763496 6月 23 13:45 gawk-5.0.0.tar.gz
[oracle@centos ff]$ tar -zxvf gawk-5.0.0.tar.gz
[oracle@centos ff]$ ll
合計 5636
drwxr-xr-x. 15 oracle docker 4096 4月 12 18:31 gawk-5.0.0
-rw-r--r--. 1 oracle docker 5763496 6月 23 13:45 gawk-5.0.0.tar.gz
[oracle@centos ff]$ cd gawk-5.0.0/
[oracle@centos gawk-5.0.0]$ pwd
/home/oracle/ff/gawk-5.0.0
[oracle@centos gawk-5.0.0]$ ll | grep conf
-rwxr-xr-x. 1 oracle docker 47840 4月 11 03:29 config.guess
-rwxr-xr-x. 1 oracle docker 18574 4月 11 03:29 config.rpath
-rwxr-xr-x. 1 oracle docker 31589 4月 11 03:29 config.sub
-rw-r--r--. 1 oracle docker 13627 4月 12 18:03 configh.in
-rwxr-xr-x. 1 oracle docker 375070 4月 12 18:03 configure
-rw-r--r--. 1 oracle docker 12818 4月 12 18:02 configure.ac
[oracle@centos gawk-5.0.0]$ ./configure
[oracle@centos gawk-5.0.0]$ make
[oracle@centos gawk-5.0.0]$ ll
合計 9684
-rw-r--r--. 1 oracle docker 94012 4月 5 16:37 ABOUT-NLS
-rw-r--r--. 1 oracle docker 495 12月 15 2017 AUTHORS
-rw-r--r--. 1 oracle docker 35147 12月 15 2017 COPYING
-rw-r--r--. 1 oracle docker 298 4月 12 18:19 ChangeLog
-rw-r--r--. 1 oracle docker 378804 4月 5 16:38 ChangeLog.0
-rw-r--r--. 1 oracle docker 15752 12月 24 05:01 INSTALL
-rw-r--r--. 1 oracle docker 42397 6月 23 13:48 Makefile
-rw-r--r--. 1 oracle docker 5841 4月 5 16:38 Makefile.am
-rw-r--r--. 1 oracle docker 43725 4月 12 18:03 Makefile.in
-rw-r--r--. 1 oracle docker 2039 4月 8 03:53 NEWS
-rw-r--r--. 1 oracle docker 85116 12月 15 2017 NEWS.0
-rw-r--r--. 1 oracle docker 18602 4月 5 16:38 NEWS.1
-rw-r--r--. 1 oracle docker 1980 12月 24 05:01 POSIX.STD
-rw-r--r--. 1 oracle docker 3852 4月 12 17:59 README
drwxr-xr-x. 2 oracle docker 4096 4月 12 18:18 README_d
-rw-r--r--. 1 oracle docker 4705 4月 5 16:38 TODO
-rw-r--r--. 1 oracle docker 42419 4月 12 18:03 aclocal.m4
-rw-r--r--. 1 oracle docker 32676 4月 5 16:38 array.c
-rw-r--r--. 1 oracle docker 137216 6月 23 13:50 array.o
-rw-r--r--. 1 oracle docker 60231 4月 11 04:06 awk.h
-rw-r--r--. 1 oracle docker 261884 4月 12 18:02 awkgram.c
-rw-r--r--. 1 oracle docker 489048 6月 23 13:50 awkgram.o
-rw-r--r--. 1 oracle docker 165324 4月 9 03:49 awkgram.y
drwxr-xr-x. 4 oracle docker 4096 6月 23 13:50 awklib
-rw-r--r--. 1 oracle docker 100458 4月 5 16:38 builtin.c
-rw-r--r--. 1 oracle docker 519832 6月 23 13:50 builtin.o
-rw-r--r--. 1 oracle docker 28915 4月 5 16:38 cint_array.c
-rw-r--r--. 1 oracle docker 103608 6月 23 13:50 cint_array.o
-rw-r--r--. 1 oracle docker 5589 4月 5 16:37 cmd.h
-rw-r--r--. 1 oracle docker 101640 4月 12 18:02 command.c
-rw-r--r--. 1 oracle docker 153760 6月 23 13:50 command.o
-rw-r--r--. 1 oracle docker 39774 4月 5 16:38 command.y
-rwxr-xr-x. 1 oracle docker 7383 4月 11 03:29 compile
-rwxr-xr-x. 1 oracle docker 47840 4月 11 03:29 config.guess
-rw-r--r--. 1 oracle docker 14345 6月 23 13:48 config.h
-rw-r--r--. 1 oracle docker 132076 6月 23 13:48 config.log
-rwxr-xr-x. 1 oracle docker 18574 4月 11 03:29 config.rpath
-rwxr-xr-x. 1 oracle docker 43287 6月 23 13:48 config.status
-rwxr-xr-x. 1 oracle docker 31589 4月 11 03:29 config.sub
-rw-r--r--. 1 oracle docker 13627 4月 12 18:03 configh.in
-rwxr-xr-x. 1 oracle docker 375070 4月 12 18:03 configure
-rw-r--r--. 1 oracle docker 12818 4月 12 18:02 configure.ac
-rw-r--r--. 1 oracle docker 2355 4月 5 16:38 custom.h
-rw-r--r--. 1 oracle docker 142002 4月 5 16:38 debug.c
-rw-r--r--. 1 oracle docker 593376 6月 23 13:50 debug.o
-rwxr-xr-x. 1 oracle docker 23568 4月 11 03:29 depcomp
drwxr-xr-x. 3 oracle docker 4096 6月 23 13:48 doc
-rw-r--r--. 1 oracle docker 43584 4月 8 03:53 eval.c
-rw-r--r--. 1 oracle docker 449304 6月 23 13:50 eval.o
-rw-r--r--. 1 oracle docker 6983 4月 5 16:38 ext.c
-rw-r--r--. 1 oracle docker 52184 6月 23 13:50 ext.o
drwxr-xr-x. 7 oracle docker 4096 6月 23 13:50 extension
drwxr-xr-x. 2 oracle docker 4096 6月 23 13:48 extras
-rw-r--r--. 1 oracle docker 43912 4月 5 16:38 field.c
-rw-r--r--. 1 oracle docker 149752 6月 23 13:50 field.o
-rw-r--r--. 1 oracle docker 3457 4月 5 16:29 floatcomp.c
-rw-r--r--. 1 oracle docker 19976 6月 23 13:50 floatcomp.o
-rw-r--r--. 1 oracle docker 1873 4月 5 16:29 floatmagic.h
-rwxr-xr-x. 1 oracle docker 2583080 6月 23 13:50 gawk
-rw-r--r--. 1 oracle docker 35948 4月 5 16:38 gawkapi.c
-rw-r--r--. 1 oracle docker 40486 4月 5 16:38 gawkapi.h
-rw-r--r--. 1 oracle docker 134312 6月 23 13:50 gawkapi.o
-rw-r--r--. 1 oracle docker 1397 4月 5 16:37 gawkmisc.c
-rw-r--r--. 1 oracle docker 37544 6月 23 13:50 gawkmisc.o
-rw-r--r--. 1 oracle docker 10478 4月 5 16:37 gettext.h
-rwxr-xr-x. 1 oracle docker 15368 4月 11 03:29 install-sh
-rw-r--r--. 1 oracle docker 20750 4月 5 16:38 int_array.c
-rw-r--r--. 1 oracle docker 76472 6月 23 13:50 int_array.o
-rw-r--r--. 1 oracle docker 36205 4月 5 16:38 interpret.h
-rw-r--r--. 1 oracle docker 112095 4月 5 16:37 io.c
-rw-r--r--. 1 oracle docker 286528 6月 23 13:50 io.o
drwxr-xr-x. 2 oracle docker 4096 4月 12 18:23 m4
-rw-r--r--. 1 oracle docker 47396 4月 8 03:53 main.c
-rw-r--r--. 1 oracle docker 188640 6月 23 13:50 main.o
-rw-r--r--. 1 oracle docker 1678 4月 5 16:37 mbsupport.h
-rwxr-xr-x. 1 oracle docker 6872 12月 24 05:01 missing
drwxr-xr-x. 2 oracle docker 4096 4月 12 18:23 missing_d
-rwxr-xr-x. 1 oracle docker 3539 4月 11 03:29 mkinstalldirs
-rw-r--r--. 1 oracle docker 39262 4月 5 16:38 mpfr.c
-rw-r--r--. 1 oracle docker 19512 6月 23 13:50 mpfr.o
-rw-r--r--. 1 oracle docker 4130 4月 5 16:37 msg.c
-rw-r--r--. 1 oracle docker 31480 6月 23 13:50 msg.o
-rw-r--r--. 1 oracle docker 24798 4月 5 16:37 node.c
-rw-r--r--. 1 oracle docker 96816 6月 23 13:50 node.o
-rw-r--r--. 1 oracle docker 2988 4月 5 16:38 nonposix.h
drwxr-xr-x. 3 oracle docker 4096 4月 12 18:23 pc
drwxr-xr-x. 2 oracle docker 4096 6月 23 13:48 po
drwxr-xr-x. 2 oracle docker 4096 4月 12 18:25 posix
-rw-r--r--. 1 oracle docker 50514 4月 5 16:38 profile.c
-rw-r--r--. 1 oracle docker 218040 6月 23 13:50 profile.o
-rw-r--r--. 1 oracle docker 4385 4月 5 16:37 protos.h
-rw-r--r--. 1 oracle docker 16272 4月 5 16:38 re.c
-rw-r--r--. 1 oracle docker 70624 6月 23 13:50 re.o
-rw-r--r--. 1 oracle docker 2879 4月 5 16:38 replace.c
-rw-r--r--. 1 oracle docker 18496 6月 23 13:50 replace.o
-rw-r--r--. 1 oracle docker 23 6月 23 13:48 stamp-h1
-rw-r--r--. 1 oracle docker 20166 4月 11 04:06 str_array.c
-rw-r--r--. 1 oracle docker 70824 6月 23 13:50 str_array.o
drwxr-xr-x. 3 oracle docker 4096 6月 23 13:50 support
-rw-r--r--. 1 oracle docker 20703 4月 5 16:38 symbol.c
-rw-r--r--. 1 oracle docker 90808 6月 23 13:50 symbol.o
drwxr-xr-x. 5 oracle docker 36864 6月 23 13:48 test
-rw-r--r--. 1 oracle docker 66 7月 19 2018 version.c
-rw-r--r--. 1 oracle docker 2408 6月 23 13:50 version.o
drwxr-xr-x. 3 oracle docker 4096 4月 12 18:22 vms
-rwxr-xr-x. 1 oracle docker 6858 12月 24 05:01 ylwrap
[oracle@centos gawk-5.0.0]$ make install
Making install in support
make[1]: ディレクトリ `/home/oracle/ff/gawk-5.0.0/support' に入ります
make[2]: ディレクトリ `/home/oracle/ff/gawk-5.0.0/support' に入ります
make[2]: `install-exec-am' に対して行うべき事はありません.
make[2]: `install-data-am' に対して行うべき事はありません.
make[2]: ディレクトリ `/home/oracle/ff/gawk-5.0.0/support' から出ます
make[1]: ディレクトリ `/home/oracle/ff/gawk-5.0.0/support' から出ます
Making install in .
make[1]: ディレクトリ `/home/oracle/ff/gawk-5.0.0' に入ります
make[2]: ディレクトリ `/home/oracle/ff/gawk-5.0.0' に入ります
/usr/bin/mkdir -p '/usr/local/bin'
./install-sh -c gawk '/usr/local/bin'
cp: 通常ファイル `/usr/local/bin/_inst.5085_' を作成できません: 許可がありません
make[2]: *** [install-binPROGRAMS] エラー 1
make[2]: ディレクトリ `/home/oracle/ff/gawk-5.0.0' から出ます
make[1]: *** [install-am] エラー 2
make[1]: ディレクトリ `/home/oracle/ff/gawk-5.0.0' から出ます
make: *** [install-recursive] エラー 1
[oracle@centos gawk-5.0.0]$ sudo make install
[oracle@centos gawk-5.0.0]$ which gawk
/usr/local/bin/gawk
[oracle@centos gawk-5.0.0]$ /usr/local/bin/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/.
[oracle@centos 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/.
~/.bashrcぐらいに実行ファイルまでのエイリアス名付けておく
docにしかバージョン文言ないから嫌。あっ、だからシンボリックリンクの概念生まれたのか。。。コピーしてリネームしておけばいいのか!!
コード表示
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
alias unkommit="/usr/local/bin/unkommit.sh"
alias awk="/usr/local/bin/awk"
alias gawk="/usr/local/bin/awk"
[oracle@centos ~]$ cd /usr/local/bin/
[oracle@centos bin]$ ll
合計 20828
lrwxrwxrwx. 1 root root 4 6月 23 13:51 awk -> gawk
-rwxr-xr-x. 1 root root 16154160 5月 12 17:20 docker-compose
-rwxr-xr-x. 2 root root 2583080 6月 23 13:51 gawk
-rwxr-xr-x. 2 root root 2583080 6月 23 13:51 gawk-5.0.0
-rwxr-xr-x. 1 root root 34 4月 5 05:57 sqldeveloper
lrwxrwxrwx. 1 root root 32 6月 22 14:06 unkommit.sh -> /home/oracle/rr/.bin/unkommit.sh
[oracle@centos bin]$ echo $PATH
/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/oracle/.local/bin:/home/oracle/bin
[oracle@centos bin]$ ll
合計 20828
lrwxrwxrwx. 1 root root 4 6月 23 13:51 awk -> gawk
-rwxr-xr-x. 1 root root 16154160 5月 12 17:20 docker-compose
-rwxr-xr-x. 2 root root 2583080 6月 23 13:51 gawk
-rwxr-xr-x. 2 root root 2583080 6月 23 13:51 gawk-5.0.0
-rwxr-xr-x. 1 root root 34 4月 5 05:57 sqldeveloper
lrwxrwxrwx. 1 root root 32 6月 22 14:06 unkommit.sh -> /home/oracle/rr/.bin/unkommit.sh
[oracle@centos bin]$ pwd
/usr/local/bin
[oracle@centos bin]$ echo $PATH
/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/home/oracle/.local/bin:/home/oracle/bin
[oracle@centos bin]$ pwd
/usr/local/bin
[oracle@centos bin]$ ll
合計 20828
lrwxrwxrwx. 1 root root 4 6月 23 13:51 awk -> gawk
-rwxr-xr-x. 1 root root 16154160 5月 12 17:20 docker-compose
-rwxr-xr-x. 2 root root 2583080 6月 23 13:51 gawk
-rwxr-xr-x. 2 root root 2583080 6月 23 13:51 gawk-5.0.0
-rwxr-xr-x. 1 root root 34 4月 5 05:57 sqldeveloper
lrwxrwxrwx. 1 root root 32 6月 22 14:06 unkommit.sh -> /home/oracle/rr/.bin/unkommit.sh
[oracle@centos bin]$ which awk
alias awk='/usr/local/bin/awk'
/usr/local/bin/awk
[oracle@centos bin]$ which gawk
alias gawk='/usr/local/bin/awk'
/usr/local/bin/awk