Manual Install Gawk

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Install GAWK in diffrent location (linux)

1- Download the source code. You can download the source code for gawk from the official GNU
website or other trusted sources. Make sure to download the specific version you want to install.

2- Extract the source code. Once the source code is downloaded, you can extract it using the tar
command. For example, if the downloaded file is gawk-5.1.0.tar.gz, you can extract it using the
following command:

$ tar -xzf gawk-5.3.0.tar.gz

3- Navigate to the source code directory. Change your current directory to the extracted source code
directory. For example:

$ cd gawk-5.1.0

4- Configure the installation. Before compiling the source code, you need to configure the installation.
This step checks for dependencies and sets up the makefile for the compilation process. You can
specify the installation location using the –prefix option. For example, to install gawk in /opt/gawk-
5.1.0, you can run the following command:

$ ./configure --prefix=/opt/gawk-5.1.0

Note:- You may need other software depending on your OS installation.

5- Compile the source code. After configuring the installation, you can compile the source code using
the make command:

$ make

6- Install gawk. Once the source code is compiled, you can install gawk using the make install
command:

$ make install
7- After the installation, rename executable /opt/gawk-5.1.0/bin/awk to awk5

$ cd /opt/gawk-5.1.0/bin
$ mv awk awk5

8- Add new path /opt/gawk-5.1.0/bin/awk to ENV PATH in .bash_profile

now you can run new gawk as awk5 and old one as awk

You might also like