21
Jun 08
Using Shell Variables with AWK
Pattern matching example:
awk '/foo1/ && /foo2/ { print $1 }'
To use shell variables simply do the following:
foo1={pattern1}
foo2={pattern2}
awk "/$foo1/ && /$foo2/"'{ print $1 }'
21
Jun 08
Pattern matching example:
awk '/foo1/ && /foo2/ { print $1 }'
To use shell variables simply do the following:
foo1={pattern1}
foo2={pattern2}
awk "/$foo1/ && /$foo2/"'{ print $1 }'
No comments yet, be the first.
Leave a Reply
You must be logged in to post a comment.