diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 14:52:31 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 14:52:31 +0300 |
commit | 3ba50a15ebd976f7a88393e2e45dc14b6478b9a9 (patch) | |
tree | 6a6bbe6bed1141051fefe94b2d39eacd4854235a /doc/awkcard.in | |
parent | 6a2caf2157d87b4b582b2494bdd7d6a688dd0b1f (diff) | |
download | egawk-3ba50a15ebd976f7a88393e2e45dc14b6478b9a9.tar.gz egawk-3ba50a15ebd976f7a88393e2e45dc14b6478b9a9.tar.bz2 egawk-3ba50a15ebd976f7a88393e2e45dc14b6478b9a9.zip |
Move to gawk-3.1.7.
Diffstat (limited to 'doc/awkcard.in')
-rw-r--r-- | doc/awkcard.in | 626 |
1 files changed, 318 insertions, 308 deletions
diff --git a/doc/awkcard.in b/doc/awkcard.in index 30591403..4642918e 100644 --- a/doc/awkcard.in +++ b/doc/awkcard.in @@ -1,7 +1,7 @@ .\" AWK Reference Card --- Arnold Robbins, arnold@skeeve.com .\" .\" Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, -.\" 2003, 2004, 2005, 2007 Free Software Foundation, Inc. +.\" 2003, 2004, 2005, 2007, 2009 Free Software Foundation, Inc. .\" .\" Permission is granted to make and distribute verbatim copies of .\" this reference card provided the copyright notice and this permission @@ -48,9 +48,9 @@ .in +.2i .nf \*(FRAction Statements 7 -Arrays 11 +Arrays 10 Awk Program Execution 4 -Bit Manipulation Functions (\*(GK) 16 +Bit Manipulation Functions (\*(GK) 15 Bug Reports 2 Closing Redirections 12 Command Line Arguments (standard) 2 @@ -59,28 +59,28 @@ Command Line Arguments (\*(MK) 4 Conversions And Comparisons 9 Copying Permissions 18 Definitions 2 -Dynamic Extensions (\*(GK) 14 -Environment Variables (\*(GK) 16 +Dynamic Extensions (\*(GK) 16 +Environment Variables (\*(GK) 17 Escape Sequences 8 -Expressions 11 +Expressions 10 Fields 6 FTP/HTTP Information 18 -Historical Features (\*(GK) 10 -Input Control 12 -Internationalization (\*(GK) 18 +Historical Features (\*(GK) 17 +Input Control 11 +Internationalization (\*(GK) 16 Lines And Statements 5 -Localization (\*(GK) 17 -Numeric Functions 14 -Output Control 12 +Localization (\*(GK) 16 +Numeric Functions 15 +Output Control 11 Pattern Elements 7 -POSIX Character Classes (\*(GK) 6 +POSIX Character Classes 6 Printf Formats 13 Records 6 Regular Expressions 5 Signals (\*(PK) 4 -Special Filenames 14 -String Functions 15 -Time Functions (\*(GK) 16 +Special Filenames 12 +String Functions 14 +Time Functions (\*(GK) 15 User-defined Functions 17 Variables 8\*(CX .in -.2i @@ -101,7 +101,7 @@ Brian Kernighan and Michael Brennan who reviewed it. .SL .nf \*(FRCopyright \(co 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -2005, 2007 Free Software Foundation, Inc. +2005, 2007, 2009 Free Software Foundation, Inc. .nf .BT @@ -193,19 +193,7 @@ read the AWK program source from the file \*(FIprog-file\*(FR, instead of from the first command line argument. Multiple \*(FC\-f\*(FR options may be used. T} -\*(FC\-\^\-\*(FR signal the end of options. -.TE -.sp .5 -.fi -\*(CLThe following options are accepted by both \*(NK and \*(GK -\*(CR(ignored by \*(GK, not in \*(MK).\*(CL -.sp .5 -.nf -.TS -expand, tab(%); -l lw(2.2i). -\*(FC\-mf \*(FIval\*(FR%set the maximum number of fields to \*(FIval\fP -\*(FC\-mr \*(FIval\*(FR%set the maximum record size to \*(FIval\fP\*(CX +\*(FC\-\^\-\*(FR signal the end of options.\*(CX .TE .EB "\s+2\f(HBCOMMAND LINE ARGUMENTS (standard)\*(FR\s0" @@ -273,8 +261,9 @@ uses \*(FCawkvars.out\*(FR. T} \*(FC\-\^\-exec \*(FIfile\*(FR%T{ read program text from \*(FIfile\fP. No other -options are processed. Useful with \*(FC#!\fP. +options are processed. Also disables command-line variable assignments. +Useful with \*(FC#!\fP. T} \*(FC\-\^\-gen\-po\*(FR%T{ process the program and print a GNU \*(FCgettext\*(FR @@ -295,14 +284,14 @@ ls l lw(2.2i). \*(FC\-\^\-lint\*(FR[\*(FC=\*(FIvalue\*(FR] %T{ -warn about constructs that are dubious -or non-portable to other \*(AKs. -With an optional argument of \*(FCfatal\*(FR, +warn about dubios or non-portable constructs. +If \*(FIvalue\*(FR is +\*(FCfatal\*(FR, lint warnings become fatal errors. -With an optional argument of +If \*(FIvalue\*(FR is \*(FCinvalid\*(FR, -only warnings about things that are -actually invalid are issued. (This is not fully implemented yet.) +only issue warnings about things that are +actually invalid (not fully implemented yet). T} .T& l lw(2.2i). @@ -320,6 +309,13 @@ recognize octal and hexadecimal values in input data. \*(FIUse this option with great caution!\*(FR T} .T& +ls +l lw(2.2i). +\*(FC\-\^\-optimize\*(FR, \*(FC\-O\*(FR +%T{ +enable some internal optimizations. +T} +.T& l lw(2.2i). \*(FC\-\^\-posix\*(FR%T{ disable common and GNU extensions. @@ -356,8 +352,13 @@ l lw(2.2i). \*(FC\-\^\-source '\*(FItext\*(FC'\*(FR %T{ use \*(FItext\*(FR as AWK program source code. +T} +.T& +l lw(2.2i). \*(FC\-\^\-version\*(FR%T{ -print version information on \*(FCstdout\fP +print version \" information +info +on \*(FCstdout\fP and exit zero. T} .T& @@ -372,7 +373,7 @@ T} .fi In compatibility mode, any other options are flagged as invalid, but are otherwise ignored. -Normally, if there is program text, unknown options +Normally, if there is program text, unknown options are passed on to the AWK program in \*(FCARGV\*(FR for processing.\*(CB @@ -586,12 +587,12 @@ this feature in \*(GK.\*(CX .BT -.\" --- POSIX Character Classes (gawk) +.\" --- POSIX Character Classes .ES .fi \*(CDIn regular expressions, within character ranges (\*(FC[\*(FR...\*(FC]\*(FR), -the notation \*(FC[[:\*(FIclass\*(FC:]]\*(FR defines character classes: +the notation \*(FC[[:\*(FIclass\*(FC:]]\*(FR defines character classes \*(CR(not \*(MK\fP)\*(CD: .sp .5 .TS center, tab(~); @@ -605,9 +606,9 @@ lp8 lp8 lp8 lp8. .TE .fi .sp .5 -Recognition of these character classes is disabled -when \*(FC\-\-traditional\*(FR is supplied.\*(CB -.EB "\s+2\f(HBPOSIX CHARACTER CLASSES (\*(GK\f(HB)\*(FR\s0" +\*(CB\*(FRRecognition of these character classes is disabled +when \*(FC\-\-traditional\*(FR is supplied.\*(CL +.EB "\s+2\f(HBPOSIX CHARACTER CLASSES\*(FR\s0" .\" --- Records .ES @@ -715,7 +716,6 @@ It matches all input records starting with a record that matches It does not combine with any other pattern expression.\*(CX .EB "\s+2\f(HBPATTERN ELEMENTS\*(FR\s0" - .\" --- Action Statements .ES .fi @@ -1020,31 +1020,6 @@ Uninitialized variables have the numeric value 0 and the string value .BT -.\" --- Historical Features -.ES -.fi -\*(CD1. It is possible to call the \*(FClength()\fP -built-in function not only with no argument, but even without parentheses. -This feature is marked as ``deprecated'' in the POSIX standard, and \*(GK -issues a warning about its use if \*(FC\-\^\-lint\fP -is specified on the command line. -.sp .5 -2. The \*(FCcontinue\fP -and \*(FCbreak\fP statements may be used outside the body of a -\*(FCwhile\*(FR, \*(FCfor\*(FR, or \*(FCdo\fP loop. -Historical AWK implementations have treated such usage as -equivalent to the \*(FCnext\fP statement. -\*(GK supports this usage if \*(FC\-\^\-traditional\fP -is specified.\*(CB -.EB "\s+2\f(HBHISTORICAL FEATURES (\*(GK\f(HB)\*(FR\s0" - -.ES -\*(CX -.sp 47 -.EB "\s+2\f(HBNOTES\*(FR\s0" - -.BT - .\" --- Arrays .ES .fi @@ -1199,7 +1174,7 @@ This usage is no longer supported. .in -.2i .sp .5 .fi -\*(FCgetline\*(FR returns 0 on end of file and \-1 on an error. +\*(FCgetline\*(FR returns 1 on success, 0 on end of file, and \-1 on an error. \*(CBUpon an error, \*(FCERRNO\*(FR contains a string describing the problem.\*(CX .EB "\s+2\f(HBINPUT CONTROL\*(FR\s0" @@ -1215,7 +1190,7 @@ flush any buffers associated with the open output file or pipe \*(FIfile\*(FR.\*(CD \*(CBIf no \*(FIfile\fP, then flush standard output. If \*(FIfile\fP is null, then flush all open output files and pipes -\*(CR(not \*(NK)\*(CD. +(\*(GK and \*(NK)\*(CD. .ti -.2i \*(FCprint\fP .br @@ -1262,6 +1237,9 @@ print data down a pipeline to co-process \*(FIcmd\*(FR.\*(CX .in -.2i .EB "\s+2\f(HBOUTPUT CONTROL\*(FR\s0" +.BT + +.\" --- Closing Redirections .ES .fi .in +.2i @@ -1285,6 +1263,85 @@ if there was a system problem. the error.\*(CX .EB "\s+2\f(HBCLOSING REDIRECTIONS\*(FR\s0" +.\" --- Special Filenames +.ES +.fi +\*(CDWhen doing I/O redirection from either \*(FCprint\fP +or \*(FCprintf\fP into a file or via \*(FCgetline\fP +from a file, all three implementations of \*(FCawk\fP +recognize certain special filenames internally. These filenames +allow access to open file descriptors inherited from the +parent process (usually the shell). +These filenames may also be used on the command line to name data files. +The filenames are: +.sp .5 +.TS +expand; +l lw(2i). +\*(FC"\-"\fP standard input +\*(FC/dev/stdin\fP standard input \*(CR(not \*(MK)\*(CD +\*(FC/dev/stdout\fP standard output +\*(FC/dev/stderr\fP standard error output +.TE +.sp .5 +.fi +\*(CBThe following names are specific to \*(GK. +.sp .5 +.in +.2i +.ti -.2i +\*(FC/dev/fd/\^\*(FIn\*(FR +.br +File associated with the open file descriptor \*(FIn\*(FR. +.ti -.2i +\*(FC/inet/tcp/\*(FIlport\*(FC/\*(FIrhost\*(FC/\*(FIrport\*(FR +.br +File for TCP/IP connection on local port \*(FIlport\*(FR to +remote host \*(FIrhost\*(FR on remote port \*(FIrport\*(FR. +Use a port of \*(FC0\*(FR to have the system pick a port. +Usable only with the \*(FC|&\*(FR two-way I/O operator. +.ti -.2i +\*(FC/inet/udp/\*(FIlport\*(FC/\*(FIrhost\*(FC/\*(FIrport\*(FR +.br +Similar, but use UDP/IP instead of TCP/IP. +.ti -.2i +\*(CR\*(FC/inet/raw/\*(FIlport\*(FC/\*(FIrhost\*(FC/\*(FIrport\*(FR +.br +.\" Similar, but use raw IP sockets. +Reserved for future use.\*(CB +.in -.2i +.sp .5 +.fi +Other special filenames provide access to information about the running +\*(FCgawk\fP process. +Reading from these files returns a single record. +The filenames and what they return are:\*(FR +.sp .5 +.TS +expand; +l lw(2i). +\*(FC/dev/pid\fP process ID of current process +\*(FC/dev/ppid\fP parent process ID of current process +\*(FC/dev/pgrpid\fP process group ID of current process +\*(FC/dev/user\fP T{ +.nf +a single newline-terminated record. +The fields are separated with spaces. +\*(FC$1\fP is the return value of \*(FIgetuid\*(FR(2), +\*(FC$2\fP is the return value of \*(FIgeteuid\*(FR(2), +\*(FC$3\fP is the return value of \*(FIgetgid\*(FR(2) , and +\*(FC$4\fP is the return value of \*(FIgetegid\*(FR(2). +.fi +Any additional fields are the group IDs returned +by \*(FIgetgroups\*(FR(2). Multiple groups may not be +supported on all systems. +T} +.TE +.sp .5 +.fi +\*(CRThese filenames are now obsolete. +Use the \*(FCPROCINFO\fP array to obtain the information they provide.\*(CL +.EB "\s+2\f(HBSPECIAL FILENAMES\*(FR\s0" + .BT .\" --- Printf Formats @@ -1296,8 +1353,7 @@ accept the following conversion specification formats: .sp .5 .nf \*(FC%c\fP an \s-1ASCII\s+1 character -\*(FC%d\fP a decimal number (the integer part) -\*(FC%i\fP a decimal number (the integer part) +\*(FC%d\fP, \*(FC%i\fP a decimal number (the integer part) \*(FC%e\fP a floating point number of the form \*(FC[\-]d.dddddde[+\^\-]dd\*(FR \*(FC%E\fP like \*(FC%e\fP, but use \*(FCE\fP instead of \*(FCe\*(FR @@ -1360,12 +1416,14 @@ T} trailing zeros are not removed. T} \*(FC0\fP T{ -a leading zero acts as a flag, indicating output -should be padded with zeros instead of spaces. +pad output with zeros instead of spaces. This applies even to non-numeric output formats. Only has an effect when the field width is wider than the value to be printed. T} +\*(CB\*(FC'\*(FR T{ +use the locale's thousands separator for \*(FC%d\fP, \*(FC%i\fP, and \*(FC%u\fP.\*(CD +T} \*(FIwidth\fP T{ pad the field to this width. The field is normally padded with spaces. If the \*(FC0\fP flag has been used, @@ -1391,8 +1449,10 @@ T} .TE .sp .5 .fi +.ig The dynamic \*(FIwidth\fP and \*(FIprec\fP capabilities of the ANSI C \*(FCprintf()\fP routines are supported. +.. A \*(FC*\fP in place of either the \*(FIwidth\fP or \*(FIprec\fP specifications causes their values to be taken from the argument list to \*(FCprintf\fP or \*(FCsprintf()\*(FR. @@ -1403,129 +1463,6 @@ with a dynamic width or precision.\*(CX .BT -.\" --- Special Filenames -.ES -.fi -\*(CDWhen doing I/O redirection from either \*(FCprint\fP -or \*(FCprintf\fP into a file or via \*(FCgetline\fP -from a file, all three implementations of \*(FCawk\fP -recognize certain special filenames internally. These filenames -allow access to open file descriptors inherited from the -parent process (usually the shell). -These filenames may also be used on the command line to name data files. -The filenames are: -.sp .5 -.TS -expand; -l lw(2i). -\*(FC"\-"\fP standard input -\*(FC/dev/stdin\fP standard input \*(CR(not \*(MK)\*(CD -\*(FC/dev/stdout\fP standard output -\*(FC/dev/stderr\fP standard error output -.TE -.sp .5 -.fi -\*(CBThe following names are specific to \*(GK. -.sp .5 -.in +.2i -.ti -.2i -\*(FC/dev/fd/\^\*(FIn\*(FR -.br -File associated with the open file descriptor \*(FIn\*(FR. -.ti -.2i -\*(FC/inet/tcp/\*(FIlport\*(FC/\*(FIrhost\*(FC/\*(FIrport\*(FR -.br -File for TCP/IP connection on local port \*(FIlport\*(FR to -remote host \*(FIrhost\*(FR on remote port \*(FIrport\*(FR. -Use a port of \*(FC0\*(FR to have the system pick a port. -Usable only with the \*(FC|&\*(FR two-way I/O operator. -.ti -.2i -\*(FC/inet/udp/\*(FIlport\*(FC/\*(FIrhost\*(FC/\*(FIrport\*(FR -.br -Similar, but use UDP/IP instead of TCP/IP. -.ti -.2i -\*(CR\*(FC/inet/raw/\*(FIlport\*(FC/\*(FIrhost\*(FC/\*(FIrport\*(FR -.br -.\" Similar, but use raw IP sockets. -Reserved for future use.\*(CB -.in -.2i -.sp .5 -.fi -Other special filenames provide access to information about the running -\*(FCgawk\fP process. -Reading from these files returns a single record. -The filenames and what they return are:\*(FR -.sp .5 -.TS -expand; -l lw(2i). -\*(FC/dev/pid\fP process ID of current process -\*(FC/dev/ppid\fP parent process ID of current process -\*(FC/dev/pgrpid\fP process group ID of current process -\*(FC/dev/user\fP T{ -.nf -a single newline-terminated record. -The fields are separated with spaces. -\*(FC$1\fP is the return value of \*(FIgetuid\*(FR(2), -\*(FC$2\fP is the return value of \*(FIgeteuid\*(FR(2), -\*(FC$3\fP is the return value of \*(FIgetgid\*(FR(2) , and -\*(FC$4\fP is the return value of \*(FIgetegid\*(FR(2). -.fi -Any additional fields are the group IDs returned -by \*(FIgetgroups\*(FR(2). Multiple groups may not be -supported on all systems. -T} -.TE -.sp .5 -.fi -\*(CRThese filenames are now obsolete. -Use the \*(FCPROCINFO\fP array to obtain the information they provide.\*(CL -.EB "\s+2\f(HBSPECIAL FILENAMES\*(FR\s0" -.sp .5 -.\" --- Builtin Numeric Functions -.ES -.fi -.TS -expand; -l lw(2i). -\*(CD\*(FCatan2(\*(FIy\*(FC, \*(FIx\*(FC)\*(FR the arctangent of \*(FIy/x\fP in radians. -\*(FCcos(\*(FIexpr\*(FC)\*(FR the cosine of \*(FIexpr\fP, which is in radians. -\*(FCexp(\*(FIexpr\*(FC)\*(FR the exponential function (\*(FIe \*(FC^ \*(FIx\*(FR). -\*(FCint(\*(FIexpr\*(FC)\*(FR truncates to integer. -\*(FClog(\*(FIexpr\*(FC)\*(FR the natural logarithm function (base \*(FIe\^\*(FR). -\*(FCrand()\fP a random number between 0 and 1 (0 \(<= \*(FIN\fP < 1). -\*(FCsin(\*(FIexpr\*(FC)\*(FR the sine of \*(FIexpr\fP, which is in radians. -\*(FCsqrt(\*(FIexpr\*(FC)\*(FR the square root function. -\&\*(FCsrand(\*(FR[\*(FIexpr\^\*(FR]\*(FC)\*(FR T{ -uses \*(FIexpr\fP as a new seed for the random number -generator. If no \*(FIexpr\fP, the time of day is used. -Returns previous seed for the random number -generator.\*(CX -T} -.TE -.EB "\s+2\f(HBNUMERIC FUNCTIONS\*(FR\s0" -.sp .5 -.\" --- Extensions -.ES -.fi -.in +.2i -.ti -.2i -\*(CD\*(FCextension(\*(FIlib\*(FC, \*(FIfunc\*(FC)\*(FR -.br -dynamically load the shared library -\*(FIlib\*(FR -and call -\*(FIfunc\*(FR -in it to initialize the library. -This adds new built-in functions to \*(GK. -It returns the value returned by -\*(FIfunc\*(FR.\*(CB -.in -.2i -.EB "\s+2\f(HBDYNAMIC EXTENSIONS (\*(GK\f(HB)\*(FR\s0" - - -.BT - .\" --- Builtin String Functions .ES .fi @@ -1662,7 +1599,30 @@ corresponding upper-case counterparts. Non-alphabetic characters are left unchanged.\*(CX .in -.2i .EB "\s+2\f(HBSTRING FUNCTIONS (continued)\*(FR\s0" - +.sp .6 +.\" --- Builtin Numeric Functions +.ES +.fi +.TS +expand; +l lw(2i). +\*(CD\*(FCatan2(\*(FIy\*(FC, \*(FIx\*(FC)\*(FR the arctangent of \*(FIy/x\fP in radians. +\*(FCcos(\*(FIexpr\*(FC)\*(FR the cosine of \*(FIexpr\fP, which is in radians. +\*(FCexp(\*(FIexpr\*(FC)\*(FR the exponential function (\*(FIe \*(FC^ \*(FIx\*(FR). +\*(FCint(\*(FIexpr\*(FC)\*(FR truncates to integer. +\*(FClog(\*(FIexpr\*(FC)\*(FR the natural logarithm function (base \*(FIe\^\*(FR). +\*(FCrand()\fP a random number between 0 and 1 (0 \(<= \*(FIN\fP < 1). +\*(FCsin(\*(FIexpr\*(FC)\*(FR the sine of \*(FIexpr\fP, which is in radians. +\*(FCsqrt(\*(FIexpr\*(FC)\*(FR the square root function. +\&\*(FCsrand(\*(FR[\*(FIexpr\^\*(FR]\*(FC)\*(FR T{ +uses \*(FIexpr\fP as a new seed for the random number +generator. If no \*(FIexpr\fP, the time of day is used. +Returns previous seed for the random number +generator.\*(CX +T} +.TE +.EB "\s+2\f(HBNUMERIC FUNCTIONS\*(FR\s0" +.sp .6 .\" --- Builtin Time Functions .ES .fi @@ -1699,7 +1659,7 @@ returns the current time of day as the number of seconds since the Epoch.\*(CB .in -.2i .EB "\s+2\f(HBTIME FUNCTIONS (\*(GK\f(HB)\*(FR\s0" - +.sp .6 .\" --- Builtin Bit Manipulation Functions .ES .fi @@ -1741,25 +1701,116 @@ teturns the bitwise XOR of the values provided by .in -.2i .EB "\s+2\f(HBBIT MANIPULATION FUNCTIONS (\*(GK\f(HB)\*(FR\s0" -.\" --- Environment Variables +.BT + +.\" --- Extensions .ES .fi -\*(CDThe environment variable \*(FCAWKPATH\fP specifies a search path to use -when finding source files named with the \*(FC\-f\fP -option. -The default path is -\*(FC".:/usr/local/share/awk"\*(FR. -.\" if this variable does not exist. -.\" (The actual directory may vary, -.\" depending upon how \*(GK was built and installed.) -If a file name given to the \*(FC\-f\fP option contains a ``/'' character, -no path search is performed. +.in +.2i +.ti -.2i +\*(CD\*(FCextension(\*(FIlib\*(FC, \*(FIfunc\*(FC)\*(FR +.br +dynamically load the shared library +\*(FIlib\*(FR +and call +\*(FIfunc\*(FR +in it to initialize the library. +This adds new built-in functions to \*(GK. +It returns the value returned by +\*(FIfunc\*(FR.\*(CB +.in -.2i +.EB "\s+2\f(HBDYNAMIC EXTENSIONS (\*(GK\f(HB)\*(FR\s0" + +.\" --- Builtin Internationalization Functions +.ES +.fi +\*(CD\*(GK +provides the following functions for runtime message translation. +.in +.2i .sp .5 -If \*(FCPOSIXLY_CORRECT\fP exists -.\" in the environment, -then \*(GK -behaves exactly as if the \*(FC\-\^\-posix\fP option had been given.\*(CB -.EB "\s+2\f(HBENVIRONMENT VARIABLES (\*(GK\f(HB)\*(FR\s0" +.ti -.2i +\*(FCbindtextdomain(\*(FIdirectory \*(FR[\*(FC, \*(FIdomain\*(FR]\*(FC)\*(FR +.br +specifies the directory where \*(GK looks for the \*(FC\&.mo\*(FR +files, in case they +will not or cannot be placed in the ``standard'' locations +(e.g., during testing.) +It returns the directory where \*(FIdomain\*(FR is ``bound.'' +.sp .5 +The default \*(FIdomain\*(FR is the value of \*(FCTEXTDOMAIN\*(FR. +When \*(FIdirectory\*(FR is the null string (\*(FC"\^"\*(FR), +\*(FCbindtextdomain()\*(FR returns the current binding for the +given \*(FIdomain\*(FR. +.ti -.2i +\*(FCdcgettext(\*(FIstring \*(FR[\*(FC, \*(FIdomain \*(FR[\*(FC, \*(FIcategory\*(FR]]\*(FC)\*(FR +.br +returns the translation of \*(FIstring\*(FR in text domain +\*(FIdomain\*(FR for locale category \*(FIcategory\*(FR. +The default value for \*(FIdomain\*(FR is the current value of \*(FCTEXTDOMAIN\*(FR. +The default value for \*(FIcategory\*(FR is \*(FC"LC_MESSAGES"\*(FR. +.sp .5 +If you supply a value for \*(FIcategory\*(FR, it must be a string equal to +one of the known locale categories. +You must also supply a text domain. Use \*(FCTEXTDOMAIN\*(FR +to use the current domain. +.ti -.2i +\*(FCdcngettext(\*(FIstring1\*(FC, \*(FIstring2\*(FC, \*(FInumber\*(FR [\*(FC, \*(FIdom \*(FR[\*(FC, \*(FIcat\*(FR]]\*(FC)\*(FR +.br +returns the plural form used for \*(FInumber\*(FR of the translation of +\*(FIstring1\*(FR and \*(FIstring2\*(FR in text domain +\*(FIdom\*(FR for locale category \*(FIcat\*(FR. +The default value for \*(FIdom\*(FR is the current value of \*(FCTEXTDOMAIN\*(FR. +\*(FC"LC_MESSAGES"\*(FR +is the default value for \*(FIcat\*(FR. +.sp .5 +If you supply a value for \*(FIcat\*(FR, it must be a string equal to +one of the known locale categories. +You must also supply a text domain. Use \*(FCTEXTDOMAIN\*(FR +to use the current domain.\*(CB +.in -.2i +.EB "\s+2\f(HBINTERNATIONALIZATION (\*(GK\f(HB)\*(FR\s0" + +.\" --- Localization +.ES +.fi +\*(CDThere are several steps involved in producing and running a localizable +\*(AK program. +.sp .5 +1. Add a \*(FCBEGIN\*(FR action to assign a value to the +\*(FCTEXTDOMAIN\*(FR variable to set the text domain for +your program. +.sp .5 +.ti +5n +\*(FCBEGIN { TEXTDOMAIN = "myprog" }\*(FR +.sp .5 +This allows \*(GK to find the \*(FC\&.mo\*(FR +file associated with your program. +Without this step, \*(GK uses the \*(FCmessages\*(FR text domain, +which probably won't work. +.sp .5 +2. Mark all strings that should be translated with leading underscores. +.sp .5 +3. Use the +\*(FCbindtextdomain()\*(FR, +\*(FCdcgettext()\*(FR, +and/or +\*(FCdcngettext()\*(FR +functions in your program, as appropriate. +.sp .5 +4. Run +.sp .5 +.ti +5n +\*(FCgawk \-\^\-gen\-po \-f myprog.awk > myprog.po\*(FR +.sp .5 +to generate a \*(FC\&.po\*(FR +file for your program. +.sp .5 +5. Provide appropriate translations, and build and install a corresponding +\*(FC\&.mo\*(FR file. +.sp .5 +The internationalization features are described in full detail in \*(AM.\*(CB +.EB "\s+2\f(HBLOCALIZATION (\*(GK\f(HB)\*(FR\s0" + .BT @@ -1815,112 +1866,60 @@ may be used in place of \*(CRNote: This usage is deprecated.\*(CX .EB "\s+2\f(HBUSER-DEFINED FUNCTIONS\*(FR\s0" -.\" --- Localization +.\" --- Environment Variables .ES .fi -\*(CDThere are several steps involved in producing and running a localizable -\*(AK program. -.sp .5 -1. Add a \*(FCBEGIN\*(FR action to assign a value to the -\*(FCTEXTDOMAIN\*(FR variable to set the text domain for -your program. -.sp .5 -.ti +5n -\*(FCBEGIN { TEXTDOMAIN = "myprog" }\*(FR -.sp .5 -This allows \*(GK to find the \*(FC\&.mo\*(FR -file associated with your program. -Without this step, \*(GK uses the \*(FCmessages\*(FR text domain, -which probably won't work. -.sp .5 -2. Mark all strings that should be translated with leading underscores. -.sp .5 -3. Use the -\*(FCbindtextdomain()\*(FR, -\*(FCdcgettext()\*(FR, -and/or -\*(FCdcngettext()\*(FR -functions in your program, as appropriate. -.sp .5 -4. Run -.sp .5 -.ti +5n -\*(FCgawk \-\^\-gen\-po \-f myprog.awk > myprog.po\*(FR -.sp .5 -to generate a \*(FC\&.po\*(FR -file for your program. -.sp .5 -5. Provide appropriate translations, and build and install a corresponding -\*(FC\&.mo\*(FR file. +\*(CDThe environment variable \*(FCAWKPATH\fP specifies a search path to use +when finding source files named with the \*(FC\-f\fP +option. +The default path is +\*(FC".:/usr/local/share/awk"\*(FR. +.\" if this variable does not exist. +.\" (The actual directory may vary, +.\" depending upon how \*(GK was built and installed.) +If a file name given to the \*(FC\-f\fP option contains a ``/'' character, +no path search is performed. .sp .5 -The internationalization features are described in full detail in \*(AM.\*(CB -.EB "\s+2\f(HBLOCALIZATION (\*(GK\f(HB)\*(FR\s0" - - -.BT +If \*(FCPOSIXLY_CORRECT\fP exists +.\" in the environment, +then \*(GK +behaves exactly as if the \*(FC\-\^\-posix\fP option had been given.\*(CB +.EB "\s+2\f(HBENVIRONMENT VARIABLES (\*(GK\f(HB)\*(FR\s0" -.\" --- Builtin Internationalization Functions +.\" --- Historical Features .ES .fi -\*(CD\*(GK -provides the following functions for runtime message translation. -.in +.2i -.sp .5 -.ti -.2i -\*(FCbindtextdomain(\*(FIdirectory \*(FR[\*(FC, \*(FIdomain\*(FR]\*(FC)\*(FR -.br -specifies the directory where \*(GK looks for the \*(FC\&.mo\*(FR -files, in case they -will not or cannot be placed in the ``standard'' locations -(e.g., during testing.) -It returns the directory where \*(FIdomain\*(FR is ``bound.'' -.sp .5 -The default \*(FIdomain\*(FR is the value of \*(FCTEXTDOMAIN\*(FR. -When \*(FIdirectory\*(FR is the null string (\*(FC"\^"\*(FR), -\*(FCbindtextdomain()\*(FR returns the current binding for the -given \*(FIdomain\*(FR. -.ti -.2i -\*(FCdcgettext(\*(FIstring \*(FR[\*(FC, \*(FIdomain \*(FR[\*(FC, \*(FIcategory\*(FR]]\*(FC)\*(FR -.br -returns the translation of \*(FIstring\*(FR in text domain -\*(FIdomain\*(FR for locale category \*(FIcategory\*(FR. -The default value for \*(FIdomain\*(FR is the current value of \*(FCTEXTDOMAIN\*(FR. -The default value for \*(FIcategory\*(FR is \*(FC"LC_MESSAGES"\*(FR. -.sp .5 -If you supply a value for \*(FIcategory\*(FR, it must be a string equal to -one of the known locale categories. -You must also supply a text domain. Use \*(FCTEXTDOMAIN\*(FR -to use the current domain. -.ti -.2i -\*(FCdcngettext(\*(FIstring1\*(FC, \*(FIstring2\*(FC, \*(FInumber\*(FR [\*(FC, \*(FIdom \*(FR[\*(FC, \*(FIcat\*(FR]]\*(FC)\*(FR -.br -returns the plural form used for \*(FInumber\*(FR of the translation of -\*(FIstring1\*(FR and \*(FIstring2\*(FR in text domain -\*(FIdom\*(FR for locale category \*(FIcat\*(FR. -The default value for \*(FIdom\*(FR is the current value of \*(FCTEXTDOMAIN\*(FR. -\*(FC"LC_MESSAGES"\*(FR -is the default value for \*(FIcat\*(FR. +\*(CDIt is possible to call the \*(FClength()\fP +built-in function not only with no argument, but even without parentheses. +This feature is marked as ``deprecated'' in the POSIX standard, and \*(GK +issues a warning about its use if \*(FC\-\^\-lint\fP +is specified on the command line. .sp .5 -If you supply a value for \*(FIcat\*(FR, it must be a string equal to -one of the known locale categories. -You must also supply a text domain. Use \*(FCTEXTDOMAIN\*(FR -to use the current domain.\*(CB -.in -.2i -.EB "\s+2\f(HBINTERNATIONALIZATION (\*(GK\f(HB)\*(FR\s0" +The \*(FCcontinue\fP +and \*(FCbreak\fP statements may be used outside the body of a +\*(FCwhile\*(FR, \*(FCfor\*(FR, or \*(FCdo\fP loop. +Historical AWK implementations have treated such usage as +equivalent to the \*(FCnext\fP statement. +\*(GK supports this usage if \*(FC\-\^\-traditional\fP +is specified.\*(CB +.EB "\s+2\f(HBHISTORICAL FEATURES (\*(GK\f(HB)\*(FR\s0" + +.BT .\" --- FTP/HTTP Information .ES .nf \*(CDHost: \*(FCftp.gnu.org\*(FR -File: \*(FC/gnu/gawk/gawk-3.1.6.tar.gz\fP +File: \*(FC/gnu/gawk/gawk-3.1.7.tar.gz\fP .in +.2i .fi GNU \*(AK (\*(GK). There may be a later version. .in -.2i .nf .sp .5 -\*(FChttp://cm.bell-labs.com/who/bwk/awk.tar.gz\fP +\*(FChttp://www.cs.princeton.edu/~bwk/btl.mirror/ +awk.tar.gz\fP .in +.2i .fi \*(NK. This version requires an ANSI C compiler; @@ -1928,11 +1927,15 @@ GCC (the GNU Compiler Collection) works well. .in -.2i .nf .sp .5 -Host: \*(FCftp.whidbey.net\*(FR -File: \*(FC/pub/brennan/mawk1.3.3.tar.gz\fP +... Host: \*(FCftp.whidbey.net\*(FR +... File: \*(FC/pub/brennan/mawk1.3.3.tar.gz\fP +... \*(FChttp://www.skeeve.com/gawk/mawk1.3.3.tar.gz\fP +Host: \*(FCinvisible-island.net\*(FR +File: \*(FC/mawk/mawk.tar.gz\fP .in +.2i .fi -Michael Brennan's \*(MK. There may be a newer version.\*(CX +Michael Brennan's \*(MK. Thomas Dickey is now +maintaining it.\*(CX .in -.2i .EB "\s+2\f(HBFTP/HTTP INFORMATION\*(FR\s0" @@ -1941,7 +1944,7 @@ Michael Brennan's \*(MK. There may be a newer version.\*(CX .ES .fi \*(CDCopyright \(co 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -2007 Free Software Foundation, Inc. +2007, 2009 Free Software Foundation, Inc. .sp .5 Permission is granted to make and distribute verbatim copies of this reference card provided the copyright notice and this permission notice @@ -1957,4 +1960,11 @@ reference card into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Foundation.\*(CX .EB "\s+2\f(HBCOPYING PERMISSIONS\*(FR\s0" +.\" Need the BT here to get the final page number + +.ES +\*(CX +.sp 28 +.EB "\s+2\f(HBNOTES\*(FR\s0" + .BT |