This topic is about AWK – Environment.
This chapter describes how to set up the AWK environment on your GNU/Linux system.
Installation Using Package Manager
Generally, AWK is available by default on most GNU/Linux distributions. You can use which command to check whether it is present on your system or not. In case you donβt have AWK, then install it on Debian based GNU/Linux using Advance Package Tool (APT) package manager as follows β
[jeryy]$ sudo apt-get update [jeryy]$ sudo apt-get install gawk
Similarly, to install AWK on RPM based GNU/Linux, use Yellowdog Updator Modifier yum package manager as follows β
[root]# yum install gawk
After installation, ensure that AWK is accessible via command line.
[jerry]$ which awk
On executing the above code, you get the following result β
/usr/bin/awk
Installation from Source Code
As GNU AWK is a part of the GNU project, its source code is available for free download. We have already seen how to install AWK using package manager. Let us now understand how to install AWK from its source code.
The following installation is applicable to any GNU/Linux software, and for most other freely-available programs as well. Here are the installation steps β
Step 1 β Download the source code from an authentic place. The command-line utility wget serves this purpose.
[jerry]$ wget http://ftp.gnu.org/gnu/gawk/gawk-4.1.1.tar.xz
Step 2 β Decompress and extract the downloaded source code.
[jerry]$ tar xvf gawk-4.1.1.tar.xz
Step 3 β Change into the directory and run configure.
[jerry]$ ./configure
Step 4 β Upon successful completion, the configure generates Makefile. To compile the source code, issue a make command.
[jerry]$ make
Step 5 β You can run the test suite to ensure the build is clean. This is an optional step.
[jerry]$ make check
Step 6 β Finally, install AWK. Make sure you have super-user privileges.
[jerry]$ sudo make install
That is it! You have successfully compiled and installed AWK. Verify it by executing the awk command as follows β
[jerry]$ which awk
On executing this code, you get the following result β
/usr/bin/awk
In this topic we learned about AWK – Environment. To know more, Click Here.
Pingback: AWK - Overview - Adglob Infosystem Pvt Ltd
Pingback: golden teacher mushroom quotes
Pingback: when to cook mushrooms