On Tuesday 11 December 2007 11:14:49 Peter Volkov wrote:
> > That way you work the same way as the classic $PATH variable.
>
> But this seems to fail if we have ':' inside path{1,2}. Is that true?
> For PATH the same question stands, but I think that ':' is used there
> for historical reasons.

Yes, that does mean you cannot use : in PATH.
I don't actually know if shells allow it to be escaped, but I do know that 
escaping does not work when IFS is concerned.

You could also use the embedded newline approach that Donnie mentioned 
earlier, but you may or may not want to go there. It's it's fairly ugly code. 
But the good news is you can now escape anything into an item, and remian 
shell portable. Here's a code snippet

FONT_CONF="conf1
conf2"

SIFS="${IFS-y}" OIFS="${IFS}"
IFS="
"
for for conffile in ${FONT_CONF}; do
....
done
if [ "${SIFS}" = "y" ]; then
   unset IFS
else
   IFS="${OIFS}"
fi

Oddly enough, you do need to quote variable assignment now as in my test even 
bash got it wrong. Probably a bug, but heh.

Thanks

Roy
--
[EMAIL PROTECTED] mailing list

Reply via email to