diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2018-11-24 19:30:55 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2018-11-24 19:30:55 +0200 |
commit | 531cf0ed26f857c2a2d3b13baf70eae72cefe6f7 (patch) | |
tree | 9656b093c799382a15e5a309c3cdcb4c1237da3f /doc/gawk.texi | |
parent | 0624fb68b8d0ad2bef23bf4e2b68297a1162ad7d (diff) | |
download | egawk-531cf0ed26f857c2a2d3b13baf70eae72cefe6f7.tar.gz egawk-531cf0ed26f857c2a2d3b13baf70eae72cefe6f7.tar.bz2 egawk-531cf0ed26f857c2a2d3b13baf70eae72cefe6f7.zip |
Allow command line assignment of typed regexps.
Diffstat (limited to 'doc/gawk.texi')
-rw-r--r-- | doc/gawk.texi | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/gawk.texi b/doc/gawk.texi index e643f1ed..663df149 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -11566,6 +11566,22 @@ sequences (@pxref{Escape Sequences}). @value{DARKCORNER} +Normally, variables assigned on the command line (with or without the +@option{-v} option) are treated as strings. When such variables are +used as numbers, @command{awk}'s normal automatic conversion of strings +to numbers takes place, and everything ``just works.'' + +However, @command{gawk} supports variables whose types are ``regexp''. +You can assign variables of this type using the following syntax: + +@example +gawk -v 're1=@/foo|bar/' '@dots{}' /path/to/file1 're2=@/baz|quux/' /path/to/file2 +@end example + +@noindent +Strongly typed regexps are an advanced feature (@pxref{Strong Regexp Constants}). +We mention them here only for completeness. + @node Conversion @subsection Conversion of Strings and Numbers |