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 ?

Alex

On Tue, Sep 14, 2004 at 12:22:27AM +1000, Crossfire wrote:
> Alexander Samad was once rumoured to have said:
> > On Mon, Sep 13, 2004 at 03:20:37PM +1000, James Gray wrote:
> > > The enclosing a variable between curly braces, eg, ${foo}  will force the 
> > > shell to expand the variable's content regardless of whether it is inside 
> > > single or double quotes. IIRC.
> > 
> > well i just tried this
> > 
> > TEST='HELLO'  echo '${TEST}'
> > and it printed out this
> > ${TEST}
> 
> Thats because the use of curlies in a variable name is for
> delimitation, and does not act as an override to the quoting syntax as
> James suggested.
> 
> 
> consider:
> 
> BLAH=Test
> echo ${BLAH}Me
> 
> which produces the output "TestMe".
> 
> This can't be done quite this way without the use of the delimiting
> braces.
> 
> They do not have any affect on quoting though. (if they did, we'd all
> be having great problems.)
> 
> C.
> -- 
> SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
> Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
> 

Attachment: 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

Reply via email to