Skip to main content

You could use the eval function

nets="searchtext" eval "awk '/"${nets}"/'" file which resolves in this example the nets variable before the awk is run.txt

nets="searchtext"
eval "awk '/"${nets}"/'" file.txt

You could use the eval function

nets="searchtext" eval "awk '/"${nets}"/'" file.txt

You could use the eval function which resolves in this example the nets variable before the awk is run.

nets="searchtext"
eval "awk '/"${nets}"/'" file.txt
Source Link

You could use the eval function

nets="searchtext" eval "awk '/"${nets}"/'" file.txt