When it comes to command line text processing, from an abstract point of view, there are three major pillars



Download 125.91 Kb.
Page3/60
Date09.03.2023
Size125.91 Kb.
#60849
1   2   3   4   5   6   7   8   9   ...   60
Learn GNU AWK

Book version


1.4
See Version_changes.md to track changes across book versions.

Installation and Documentation


The command name awk is derived from its developers — Alfred V. Aho, Peter J. Weinberger, and Brian W. Kernighan. Over the years, it has been adapted and modified by various other developers. See gawk manual: History for more details. This chapter will show how to install or upgrade awk followed by details related to documentation.

Installation


If you are on a Unix like system, you are most likely to already have some version of awk installed. This book is primarily for GNU awk. As there are syntax and feature differences between various implementations, please make sure to follow along with what is presented here. GNU awk is part of text creation and manipulation commands provided by GNU. To install newer or particular version, visit gnu: software gawk. Check release notes for an overview of changes between versions.
$ # use a dir, say ~/Downloads/awk_install before following the steps below $ wget https://ftp.gnu.org/gnu/gawk/gawk-5.1.0.tar.xz $ tar -Jxf gawk-5.1.0.tar.xz $ cd gawk-5.1.0/ $ ./configure $ make $ sudo make install $ type -a awk awk is /usr/local/bin/awk awk is /usr/bin/awk $ awk --version | head -n1 GNU Awk 5.1.0, API: 3.0
See also gawk manual: Installation for advanced options and instructions to install awk on other platforms.

Documentation


It is always a good idea to know where to find the documentation. From command line, you can use man awk for a short manual and info awk for full documentation. The online GNU awk manual has a better reading interface and provides the most complete documentation, examples and information about other awk versions, POSIX standard, etc.
Here's a snippet from man awk:
$ man awk GAWK(1) Utility Commands GAWK(1) NAME gawk - pattern scanning and processing language SYNOPSIS gawk [ POSIX or GNU style options ] -f program-file [ -- ] file ... gawk [ POSIX or GNU style options ] [ -- ] program-text file ... DESCRIPTION Gawk is the GNU Project's implementation of the AWK programming lan‐ guage. It conforms to the definition of the language in the POSIX 1003.1 Standard. This version in turn is based on the description in The AWK Programming Language, by Aho, Kernighan, and Weinberger. Gawk provides the additional features found in the current version of Brian Kernighan's awk and numerous GNU-specific extensions.

Download 125.91 Kb.

Share with your friends:
1   2   3   4   5   6   7   8   9   ...   60




The database is protected by copyright ©ininet.org 2024
send message

    Main page