<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://gunkies.org/index.php?action=history&amp;feed=atom&amp;title=32v_1m_awk</id>
		<title>32v 1m awk - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://gunkies.org/index.php?action=history&amp;feed=atom&amp;title=32v_1m_awk"/>
		<link rel="alternate" type="text/html" href="https://gunkies.org/w/index.php?title=32v_1m_awk&amp;action=history"/>
		<updated>2026-05-29T23:43:26Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.1</generator>

	<entry>
		<id>https://gunkies.org/w/index.php?title=32v_1m_awk&amp;diff=6922&amp;oldid=prev</id>
		<title>Neozeed: New page: AWK(1)              UNIX Programmer's Manual               AWK(1)    == NAME ==      awk - pattern scanning and processing language  == SYNOPSIS ==      awk [ -F_c ] [ prog ] [ file ] ... ...</title>
		<link rel="alternate" type="text/html" href="https://gunkies.org/w/index.php?title=32v_1m_awk&amp;diff=6922&amp;oldid=prev"/>
				<updated>2009-10-26T12:37:47Z</updated>
		
		<summary type="html">&lt;p&gt;New page: AWK(1)              UNIX Programmer&amp;#039;s Manual               AWK(1)    == NAME ==      awk - pattern scanning and processing language  == SYNOPSIS ==      awk [ -F_c ] [ prog ] [ file ] ... ...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;AWK(1)              UNIX Programmer's Manual               AWK(1)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== NAME ==&lt;br /&gt;
     awk - pattern scanning and processing language&lt;br /&gt;
&lt;br /&gt;
== SYNOPSIS ==&lt;br /&gt;
     awk [ -F_c ] [ prog ] [ file ] ...&lt;br /&gt;
&lt;br /&gt;
== DESCRIPTION ==&lt;br /&gt;
     _A_w_k scans each input _f_i_l_e for lines that match any of a set&lt;br /&gt;
     of patterns specified in _p_r_o_g.  With each pattern in _p_r_o_g&lt;br /&gt;
     there can be an associated action that will be performed&lt;br /&gt;
     when a line of a _f_i_l_e matches the pattern.  The set of pat-&lt;br /&gt;
     terns may appear literally as _p_r_o_g, or in a file specified&lt;br /&gt;
     as -f _f_i_l_e.&lt;br /&gt;
&lt;br /&gt;
     Files are read in order; if there are no files, the standard&lt;br /&gt;
     input is read.  The file name `-' means the standard input.&lt;br /&gt;
     Each line is matched against the pattern portion of every&lt;br /&gt;
     pattern-action statement; the associated action is performed&lt;br /&gt;
     for each matched pattern.&lt;br /&gt;
&lt;br /&gt;
     An input line is made up of fields separated by white space.&lt;br /&gt;
     (This default can be changed by using FS, _v_i_d_e _i_n_f_r_a.) The&lt;br /&gt;
     fields are denoted $1, $2, ... ; $0 refers to the entire&lt;br /&gt;
     line.&lt;br /&gt;
&lt;br /&gt;
     A pattern-action statement has the form&lt;br /&gt;
&lt;br /&gt;
          pattern { action }&lt;br /&gt;
&lt;br /&gt;
     A missing { action } means print the line; a missing pattern&lt;br /&gt;
     always matches.&lt;br /&gt;
&lt;br /&gt;
     An action is a sequence of statements.  A statement can be&lt;br /&gt;
     one of the following:&lt;br /&gt;
&lt;br /&gt;
          if ( conditional ) statement [ else statement ]&lt;br /&gt;
          while ( conditional ) statement&lt;br /&gt;
          for ( expression ; conditional ; expression ) statement&lt;br /&gt;
          break&lt;br /&gt;
          continue&lt;br /&gt;
          { [ statement ] ... }&lt;br /&gt;
          variable = expression&lt;br /&gt;
          print [ expression-list ] [ &amp;gt;expression ]&lt;br /&gt;
          printf format [ , expression-list ] [ &amp;gt;expression ]&lt;br /&gt;
          next # skip remaining patterns on this input line&lt;br /&gt;
          exit # skip the rest of the input&lt;br /&gt;
&lt;br /&gt;
     Statements are terminated by semicolons, newlines or right&lt;br /&gt;
     braces.  An empty expression-list stands for the whole line.&lt;br /&gt;
     Expressions take on string or numeric values as appropriate,&lt;br /&gt;
     and are built using the operators +, -, *, /, %,  and con-&lt;br /&gt;
     catenation (indicated by a blank).  The C operators ++, --,&lt;br /&gt;
     +=, -=, *=, /=, and %= are also available in expressions.&lt;br /&gt;
     Variables may be scalars, array elements (denoted x[i]) or&lt;br /&gt;
     fields.  Variables are initialized to the null string.&lt;br /&gt;
     Array subscripts may be any string, not necessarily numeric;&lt;br /&gt;
     this allows for a form of associative memory.  String con-&lt;br /&gt;
     stants are quoted &amp;quot;...&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
     The _p_r_i_n_t statement prints its arguments on the standard&lt;br /&gt;
     output (or on a file if &amp;gt;_f_i_l_e is present), separated by the&lt;br /&gt;
     current output field separator, and terminated by the output&lt;br /&gt;
     record separator.  The _p_r_i_n_t_f statement formats its expres-&lt;br /&gt;
     sion list according to the format (see _p_r_i_n_t_f(3)).&lt;br /&gt;
&lt;br /&gt;
     The built-in function _l_e_n_g_t_h returns the length of its argu-&lt;br /&gt;
     ment taken as a string, or of the whole line if no argument.&lt;br /&gt;
     There are also built-in functions _e_x_p, _l_o_g, _s_q_r_t, and _i_n_t.&lt;br /&gt;
     The last truncates its argument to an integer.&lt;br /&gt;
     _s_u_b_s_t_r(_s, _m, _n) returns the _n-character substring of _s that&lt;br /&gt;
     begins at position _m.  The function&lt;br /&gt;
     _s_p_r_i_n_t_f(_f_m_t, _e_x_p_r, _e_x_p_r, ...) formats the expressions&lt;br /&gt;
     according to the _p_r_i_n_t_f(3) format given by _f_m_t and returns&lt;br /&gt;
     the resulting string.&lt;br /&gt;
&lt;br /&gt;
     Patterns are arbitrary Boolean combinations (!, ||, &amp;amp;&amp;amp;, and&lt;br /&gt;
     parentheses) of regular expressions and relational expres-&lt;br /&gt;
     sions.  Regular expressions must be surrounded by slashes&lt;br /&gt;
     and are as in _e_g_r_e_p.  Isolated regular expressions in a pat-&lt;br /&gt;
     tern apply to the entire line.  Regular expressions may also&lt;br /&gt;
     occur in relational expressions.&lt;br /&gt;
&lt;br /&gt;
     A pattern may consist of two patterns separated by a comma;&lt;br /&gt;
     in this case, the action is performed for all lines between&lt;br /&gt;
     an occurrence of the first pattern and the next occurrence&lt;br /&gt;
     of the second.&lt;br /&gt;
&lt;br /&gt;
     A relational expression is one of the following:&lt;br /&gt;
&lt;br /&gt;
          expression matchop regular-expression&lt;br /&gt;
          expression relop expression&lt;br /&gt;
&lt;br /&gt;
     where a relop is any of the six relational operators in C,&lt;br /&gt;
     and a matchop is either ~ (for contains) or !~ (for does not&lt;br /&gt;
     contain).  A conditional is an arithmetic expression, a&lt;br /&gt;
     relational expression, or a Boolean combination of these.&lt;br /&gt;
&lt;br /&gt;
     The special patterns BEGIN and END may be used to capture&lt;br /&gt;
     control before the first input line is read and after the&lt;br /&gt;
     last.  BEGIN must be the first pattern, END the last.&lt;br /&gt;
&lt;br /&gt;
     A single character _c may be used to separate the fields by&lt;br /&gt;
     starting the program with&lt;br /&gt;
&lt;br /&gt;
          BEGIN { FS = &amp;quot;c&amp;quot; }&lt;br /&gt;
&lt;br /&gt;
     or by using the -F_c option.&lt;br /&gt;
&lt;br /&gt;
     Other variable names with special meanings include NF, the&lt;br /&gt;
     number of fields in the current record; NR, the ordinal&lt;br /&gt;
     number of the current record; FILENAME, the name of the&lt;br /&gt;
     current input file; OFS, the output field separator (default&lt;br /&gt;
     blank); ORS, the output record separator (default newline);&lt;br /&gt;
     and OFMT, the output format for numbers (default &amp;quot;%.6g&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
== EXAMPLES ==&lt;br /&gt;
     Print lines longer than 72 characters:&lt;br /&gt;
&lt;br /&gt;
          length &amp;gt; 72&lt;br /&gt;
&lt;br /&gt;
     Print first two fields in opposite order:&lt;br /&gt;
&lt;br /&gt;
          { print $2, $1 }&lt;br /&gt;
&lt;br /&gt;
     Add up first column, print sum and average:&lt;br /&gt;
&lt;br /&gt;
               { s += $1 }&lt;br /&gt;
          END  { print &amp;quot;sum is&amp;quot;, s, &amp;quot; average is&amp;quot;, s/NR }&lt;br /&gt;
&lt;br /&gt;
     Print fields in reverse order:&lt;br /&gt;
&lt;br /&gt;
          { for (i = NF; i &amp;gt; 0; --i) print $i }&lt;br /&gt;
&lt;br /&gt;
     Print all lines between start/stop pairs:&lt;br /&gt;
&lt;br /&gt;
          /start/, /stop/&lt;br /&gt;
&lt;br /&gt;
     Print all lines whose first field is different from previous&lt;br /&gt;
     one:&lt;br /&gt;
&lt;br /&gt;
          $1 != prev { print; prev = $1 }&lt;br /&gt;
&lt;br /&gt;
== SEE ALSO ==&lt;br /&gt;
     [[32v 1m lex|lex(1)]], [[32v 1m sed|sed(1)]]&lt;br /&gt;
     A. V. Aho, B. W. Kernighan, P. J. Weinberger, _A_w_k - _a _p_a_t_-&lt;br /&gt;
     _t_e_r_n _s_c_a_n_n_i_n_g _a_n_d _p_r_o_c_e_s_s_i_n_g _l_a_n_g_u_a_g_e&lt;br /&gt;
&lt;br /&gt;
== BUGS ==&lt;br /&gt;
     There are no explicit conversions between numbers and&lt;br /&gt;
     strings.  To force an expression to be treated as a number&lt;br /&gt;
     add 0 to it; to force it to be treated as a string concaten-&lt;br /&gt;
     ate &amp;quot;&amp;quot; to it.&lt;br /&gt;
&lt;br /&gt;
[[Category:32v man section 1]]&lt;/div&gt;</summary>
		<author><name>Neozeed</name></author>	</entry>

	</feed>