If I have an awk command
pattern { ... }
and pattern uses a capturing group, how can I access the string so captured in the block?
If I have an awk command
pattern { ... }
and pattern uses a capturing group, how can I access the string so captured in the block?
That was a stroll down memory lane...
I replaced awk by perl a long time ago.
Apparently the AWK regular expression engine does not capture its groups.
you might consider using something like :
perl -n -e'/test(\d+)/ && print $1'
the -n flag causes perl to loop over every line like awk does.