aboutsummaryrefslogtreecommitdiffstats
path: root/doc/gawk.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/gawk.texi')
-rw-r--r--doc/gawk.texi64
1 files changed, 49 insertions, 15 deletions
diff --git a/doc/gawk.texi b/doc/gawk.texi
index c1095a9f..e661c6fa 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -15756,6 +15756,30 @@ The values indicate what @command{gawk} knows about the identifiers
after it has finished parsing the program; they are @emph{not} updated
while the program runs.
+@item PROCINFO["platform"]
+@cindex platform running on, @code{PROCINFO["platform"]}
+This element gives a string indicating the platform for which
+@command{gawk} was compiled. The value will be one of the following:
+
+@c nested table
+@table @code
+@item "vms"
+OpenVMS or Vax/VMS.
+
+@item "djgpp"
+@itemx "mingw"
+Microsoft Windows, using either DJGPP or MinGW, respectively.
+
+@item "os2"
+OS/2.
+
+@item "os390"
+OS/390.
+
+@item "posix"
+GNU/Linux, Cygwin, Mac OS X, and legacy Unix systems.
+@end table
+
@item PROCINFO["pgrpid"]
@cindex process group ID of @command{gawk} process
The process group ID of the current process.
@@ -15916,7 +15940,8 @@ if an element in @code{SYMTAB} is an array.
Also, you may not use the @code{delete} statement with the
@code{SYMTAB} array.
-You may use an index for @code{SYMTAB} that is not a predefined identifier:
+Prior to @value{PVERSION} 5.0 of @command{gawk}, you could
+use an index for @code{SYMTAB} that was not a predefined identifier:
@example
SYMTAB["xxx"] = 5
@@ -15924,9 +15949,8 @@ print SYMTAB["xxx"]
@end example
@noindent
-This works as expected: in this case @code{SYMTAB} acts just like
-a regular array. The only difference is that you can't then delete
-@code{SYMTAB["xxx"]}.
+This no longer works, instead producing a fatal error, as it led
+to rampant confusion.
@cindex Schorr, Andrew
The @code{SYMTAB} array is more interesting than it looks. Andrew Schorr
@@ -29103,6 +29127,7 @@ of the program and the precedence rules.
For example, @samp{(3 + 5) * 4} means add three and five, then multiply
the total by four. However, @samp{3 + 5 * 4} has no parentheses, and
means @samp{3 + (5 * 4)}.
+However, explicit parentheses in the source program are retained.
@ignore
@item
@@ -29141,12 +29166,14 @@ come out as:
@example
/foo/ @{
- print $0
+ print
@}
@end example
@noindent
which is correct, but possibly unexpected.
+(If a program uses both @samp{print $0} and plain
+@samp{print}, that distinction is retained.)
@cindex profiling @command{awk} programs, dynamically
@cindex @command{gawk} program, dynamic profiling
@@ -29234,12 +29261,10 @@ There is a significant difference between the output created when
profiling, and that created when pretty-printing. Pretty-printed output
preserves the original comments that were in the program, although their
placement may not correspond exactly to their original locations in the
-source code.@footnote{@command{gawk} does the best it can to preserve
+source code. However, no comments should be lost.
+Also, @command{gawk} does the best it can to preserve
the distinction between comments at the end of a statement and comments
-on lines by themselves. Due to implementation constraints, it does not
-always do so correctly, particularly for @code{switch} statements. The
-@command{gawk} maintainers hope to improve this in a subsequent
-release.}
+on lines by themselves. This isn't always perfect, though.
However, as a deliberate design decision, profiling output @emph{omits}
the original program's comments. This allows you to focus on the
@@ -38928,6 +38953,14 @@ Support for GNU/Linux on Alpha was removed.
@end itemize
+Version 5.0 added the following features:
+
+@itemize
+@item
+The @code{PROCINFO["platform"]} array element, which allows you
+to write code that takes the operating system / platform into account.
+@end itemize
+
@c XXX ADD MORE STUFF HERE
@end ifclear
@@ -39890,11 +39923,6 @@ include the major and minor API versions in it. This makes it possible
to keep extensions for different API versions on the same system
without their conflicting with one another.
-@cindex @option{--with-whiny-user-strftime} configuration option
-@cindex configuration option, @code{--with-whiny-user-strftime}
-@item --with-whiny-user-strftime
-Force use of the included version of the C @code{strftime()}
-function for deficient systems.
@end table
Use the command @samp{./configure --help} to see the full list of
@@ -40080,6 +40108,12 @@ appropriate @samp{-v BINMODE=@var{N}} option on the command line.
@code{BINMODE} is set at the time a file or pipe is opened and cannot be
changed midstream.
+On POSIX-compatible systems, this variable's value has no effect.
+Thus, if you think your program will run on multiple different systems
+and that you may need to use @code{BINMODE}, you should simply set it
+(in the program or on the command line) unconditionally, and not worry
+about the operating system on which your program is running.
+
The name @code{BINMODE} was chosen to match @command{mawk}
(@pxref{Other Versions}).
@command{mawk} and @command{gawk} handle @code{BINMODE} similarly; however,