/regexp/ is considered a constant, so it won't let you put any variables in the
pattern
This page:
http://www.math.utah.edu/docs/info/gawk_5.html#SEC32
reckons that
$0 ~ search { printf("%s\n",$0) }
will work ... it did for me.
HTH,
- Rog ... just learnt some awk :)
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Peter Rundle
> Sent: Friday, 11 June 2004 10:36 AM
> To: [EMAIL PROTECTED]
> Subject: [SLUG] Awk parameter as search string
>
> Sluggers,
>
> Does anyone know how to use an argument to awk as a pattern match?
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html