by gazelle@[EMAIL PROTECTED]
(Kenny McCormack)
Dec 22, 2007 at 09:15 PM
In article <slrnfmqmho.988.mar***bill@[EMAIL PROTECTED]
>,
Bill Mar*** <mar***bill@[EMAIL PROTECTED]
> wrote:
>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'
You forgot to include the fine print.