-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Angel Tsankov on 2/15/2009 3:02 PM:
> I tried CPATH="${CPATH}${CPATH:+:}"~usr1/blah/blah.  (I quote 
> expansions just to be on the safe side, though I think home directories may 
> not contain spaces.)

There are some contexts, such as variable assignments, where double quotes
are not necessary.

foo='a b'
bar=$foo

is just as safe as

bar="$foo"

In fact, it is MORE portable to avoid double quotes in assignments, if you
are worried about writing scripts portable to more than just bash.  Of
these two constructs:

foo="`echo "a b"`"
bar=`echo "a b"`

only the setting of bar is guaranteed to parse correctly in all shells.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             e...@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmY7EYACgkQ84KuGfSFAYAmlwCgn5o87vKmCfyvi95ILDQ/1dD0
C/wAn1WRWAeh4eUghCNYLBLMSiU+j9vq
=jFAM
-----END PGP SIGNATURE-----


Reply via email to