Category:AWK: Difference between revisions

From Rosetta Code
Content added Content deleted
m (→‎Online-Execution: tutorialspoint.com/codingground.htm)
m (update links)
 
(5 intermediate revisions by 3 users not shown)
Line 22: Line 22:
==Links==
==Links==
*[http://leaf.dragonflybsd.org/cgi/web-man?command=awk&section=1 awk(1) manual page], short and brief
*[http://leaf.dragonflybsd.org/cgi/web-man?command=awk&section=1 awk(1) manual page], short and brief
*[https://www.gnu.org/software/gawk/ gawk] GNU awk [https://www.gnu.org/software/gawk/manual/ manual]
*[[wp:AWK (programming language)|AWK in Wikipedia]]
*[[wp:AWK (programming language)|AWK in Wikipedia]]
*[http://awk.info AWK Community Portal]
*[http://awk.info AWK Community Portal]


==Online-Execution==
==Online-Execution==
* [https://ideone.com ideone.com] - gawk, mawk (both are kept up to date)
* [http://www.compileonline.com/execute_awk_online.php compileonline.com] - gawk 4.1.0 (2013) - this has been renamed (2014-11-16) to codingground.tutorialspoint.com:

* [http://www.tutorialspoint.com/execute_awk_online.php tutorialspoint.com/codingground.htm] - gawk 4.1.0 (2013)
==Todo==
* [http://ideone.com ideone.com] - gawk 3.1.6 (2007), mawk 1.3.3 (Nov 1996)
[[Tasks_not_implemented_in_AWK]]

Latest revision as of 18:59, 8 August 2023

Language
AWK
This programming language may be used to instruct a computer to perform a task.
Execution method: Interpreted
See Also:


Listed below are all of the tasks on Rosetta Code which have been solved using AWK.

AWK is a small but powerful programming language that can process and convert text files. AWK is part of every Unix-derived system.

Each AWK program consists of pattern-action statements. The program reads each input line, checks lines against patterns, and runs matching actions. For programs that never read input lines, the entire program can be one BEGIN { ... } block.

  • List users who have /bin/ksh as a shell.<lang awk>$ awk -F: '$7 == "/bin/ksh" { print $1 }' /etc/passwd</lang>

AWK has only three types of variables: they are strings, floating-point numbers, and associative arrays (where every array index is a string). Conversion between strings and numbers is automatic. AWK also has regular expressions, which appear in many AWK programs. There are a few built-in functions, like cos() and sprintf().

  • Find average line length.<lang awk>$ awk '{ cnt += length($0) } END { print cnt / NR }' /etc/rc</lang>

The name "AWK" comes from the initials of Alfred Aho, Peter Weinberger and Brian Kernighan: they invented AWK during the 1970s. A few decades later, Kernighan continues to maintain the reference implementation of AWK.

Links

Online-Execution

  • ideone.com - gawk, mawk (both are kept up to date)

Todo

Tasks_not_implemented_in_AWK

Subcategories

This category has the following 4 subcategories, out of 4 total.

Pages in category "AWK"

The following 200 pages are in this category, out of 709 total.

(previous page) (next page)

C

(previous page) (next page)