Download AWK to Ubuntu

How to download awk to Ubuntu, since I tried to use asorti function and it told me that there is an error on this asorti. I tried many scripts that used asorti function and the same error occure!

3

2 Answers

It sounds like your system is using mawk to provide awk - you can check with

update-alternatives --display awk

If that is the case, you should be able to install GNU awk (gawk) from the repository either using the Software Center or other GUI package manager, or via the command line using

sudo apt-get update
sudo apt-get install gawk

This should automatically set your default awk to gawk using the update-alternatives mechanism - if you need to set it back to mawk you can do so by running

sudo update-alternatives --config awk

and following the on-screen instructions. The asorti function is a GNU awk extension.

6

You can also download the gawk source code files from and then proceed to compile them. This approach may be useful if you want to use a specific version of gawk other than the one provided by the gawk package in Ubuntu's repositories.

After downloading the source code, extract the files in a given directory /home/user/gawk/ and then:

cd /home/user/gawk
./configure
make
sudo make install

Most probably it will be installed in something like /usr/local/bin/gawk-4.X.Y, being X and Y numbers that change on every new release.

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like