bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gawk] Assigning RegExp Variables on the Command Line


From: Marcus
Subject: [bug-gawk] Assigning RegExp Variables on the Command Line
Date: Sun, 06 Oct 2019 13:00:15 +0300

Hello! I suppose there's a misprint in the manual dealing with assigning regexp 
variables on the command line (v 5.1.0, sec. 6.1.3.2).

gawk -v ’re1=foo|bar/’ ’...’ /path/to/file1 ’re2=baz|quux/’ /path/to/file2

If I run it "as is", I'll get:

$ /path/to/gawk -v 're1=foo|bar/' 'BEGIN { print typeof(re1); print re1; exit }'
string
foo|bar/
$

This version works for me:

$ /path/to/gawk -v 're1=@/foo|bar/' 'BEGIN { print typeof(re1); print re1; exit 
}'
regexp
foo|bar
$

_______________

Yours respectfully,
Mark Krauze

P.S. Dear recipients! If you read this, YES, this is my new e-mail address.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]