On Wed, 2007-11-14 at 14:53 +0100, Torsten Rehn wrote:
> On Wednesday 14 November 2007 14:21, you wrote:
> > But why is it standard to quote other assignments like in DESCRIPTION and
> > HOMEPAGE then?
> 
> When assigning literal values as in DESCRIPTION and HOMEPAGE, you have to 
> quote. ${WORKDIR} is quoted on its assignment and therefore does not have to 
> be quoted when assigning its value to another variable (${S}) by reference.
> 

Note, however, that for example in /usr/lib/portage/bin/ebuild.sh, it's
always quoted (except once, which looks like an oversight).  Example:

ebuild.sh:1081: if [ "${PORTAGE_BUILDDIR}/.tested" -nt "${WORKDIR}" ];
then

or

ebuild.sh:1090:         cd "${WORKDIR}"

(The line that looks like an oversight is:

ebuild.sh:1019: if [[ ${PORTAGE_BUILDDIR}/.compiled -nt ${WORKDIR} ]] ;
then
)

> [EMAIL PROTECTED] > cat test.sh
> #!/bin/bash
> TEXT="A B"
> Q=${TEXT}
> echo ${TEXT}
> FAIL=DONT TRYTHISATHOME
> [EMAIL PROTECTED] > ./test.sh
> A B
> ./test.sh: line 5: TRYTHISATHOME: command not found

-- 
Ferris McCormick (P44646, MI) <[EMAIL PROTECTED]>
Developer, Gentoo Linux (Devrel, Sparc)

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to