On Tue, Sep 14, 2004 at 10:54:42AM +1000, Robert Thorsby wrote:
> On 2004.09.14 10:39 Alexander Samad wrote:
> >What about in a here doc
> >so some thing like
> >
> >#!/bin/bash
> >
> >TEST='here'
> >cat << EOF
> >awk '/$TEST/ {print}' /somefile
> >EOF
> >
> >do the ' still keep there meaning in a here doc ?
>
> Wouldn't it be a lot easier to use awk's -v option (that's the reason
> it's there):
> #!/bin/bash
>
> TEST="Here"
> echo "is a test" |
> /usr/bin/awk -v i="$TEST" '{print ("\"" i, $0 ".\"")}'Cool learn something new, but does it work in the // regex part ? > > > Robert Thorsby > -- > SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ > Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html >
signature.asc
Description: Digital signature
-- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
