by Bill Marcum <marcumbill@[EMAIL PROTECTED]
>
Dec 22, 2007 at 01:40 PM
On 2007-12-22, mcbalagtas@[EMAIL PROTECTED]
<mcbalagtas@[EMAIL PROTECTED]
> wrote:
>
>
> Ok after searching, I figured out I can't use a variable in a pattern
> search in awk. But it hard for me to give it up since it works so
> cleanly. The awk statement below gives me the exact output I need.
> Except for the fact it won't let me change the the pattern for $2.
>
You can use a variable as a pattern. Just don't enclose it in / /.
awk -v var=foo '$2~var'