gawk的官网进行下载(Index of /gnu/gawk)。
下载完后,解压,进入目录,编译,安装:
tar xvzf gawk-4.1.4.tar.gz
cd gawk-4.1.4/
./configure
make
sudo make install
如果报以下错误:
checking for gmsgfmt... no checking for msgfmt... no checking for makeinfo... no checking for sed... sed checking version of sed... 4.7, ok checking for gawk... gawk checking version of gawk... 4.1.4, ok checking for bison... no checking if gcc is sufficient to build libc... yes checking for nm... nm checking for python3... python3 checking version of python3... 3.8.10, ok configure: error: *** These critical programs are missing or too old: bison *** Check the INSTALL file for required versions.
bison
没有被找到或者版本过旧,configure
脚本终止了执行并报告了错误。
ubuntu安装bison的命令:
sudo apt-get update
sudo apt-get install bison
之后就可以执行了。