[PLUG] Bash variable substitutions for awk...

Rich Shepard rshepard at appl-ecosys.com
Wed Mar 29 12:53:52 UTC 2017


On Tue, 28 Mar 2017, Russell Senior wrote:

> If you want to use an external variable inside an awk script, you
> generally need to use the -v var=val or (long) --assign=var=val command
> line options. See --help or the appropriate manpage for details. Something
> like (not tested):
>
>  awk -v each=${each} '$32 == each { print ... }' ${inputfile}

   Would the pattern match syntax, ${each} ~ $32, also work?

Rich



More information about the PLUG mailing list