lundi 7 janvier 2019

How do I use awk to match multiple variable patterns?

I want to use awk to match multiple variable patterns. Here is what I have so far:

    match=`awk -v "$var1\|$var2\|$var3"  'BEGIN{FS=":"; OFS="-"} $2 ~ {print}' $file`

Any help is appreciated.

Aucun commentaire:

Enregistrer un commentaire