aboutsummaryrefslogtreecommitdiffstats
path: root/doc/gawktexi.in
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2019-04-18 19:58:51 +0300
committerArnold D. Robbins <arnold@skeeve.com>2019-04-18 19:58:51 +0300
commit5e739d0e99d4833092dff655bc4e9d9e05046e74 (patch)
tree44a5f1258101fc8bb15c3442d5d419960784f6d4 /doc/gawktexi.in
parentc67cff427d7a0628786cac067f3d55e53892e5c8 (diff)
downloadegawk-5e739d0e99d4833092dff655bc4e9d9e05046e74.tar.gz
egawk-5e739d0e99d4833092dff655bc4e9d9e05046e74.tar.bz2
egawk-5e739d0e99d4833092dff655bc4e9d9e05046e74.zip
Add an easter egg in msg.c.
Diffstat (limited to 'doc/gawktexi.in')
-rw-r--r--doc/gawktexi.in13
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 14e20b7a..0408d61c 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -4945,6 +4945,19 @@ returns a textual version of the flags for scalar variables, and the
array back-end implementation type for arrays. This interface is subject
to change and may not be stable.
+When not in POSIX or compatibility mode, if you set @code{LINENO} to a
+numeric value using the @option{-v} option, @command{gawk} adds that value
+to the real line number for use in error messages. This is intended for
+use within Bash shell scripts, such that the error message will reflect
+the line number in the shell script, instead of in the @command{awk}
+program. To demonstrate:
+
+@exmaple
+$ @kbd{gawk -v LINENO=10 'BEGIN @{ print("hi" @}'}
+@error{} gawk: cmd. line:11: BEGIN @{ print("hi" @}
+@error{} gawk: cmd. line:11: ^ syntax error
+@end example
+
@end ignore
@node Invoking Summary