On Thu, 29 Aug 2013 10:41:08 +0400 Sergey Popov <[email protected]> wrote:
> 28.08.2013 20:06, hasufell пишет:
> > On 08/28/2013 05:53 PM, "Paweł Hajdan, Jr." wrote:
> And if WORKDIR will contain whitespace(s), does this code still be
> working? :-)
>
> // sorry for bikeshedding, can not resist
Just try it out ...
WORKDIR="SOME WORK DIR"
S=${WORKDIR}/SUBDIR
echo ${S}
Output: SOME WORK DIR/SUBDIR
... and you will see that this works.
Although on the other hand you can't do ...
S=SOME WORK DIR/SUBDIR
echo ${S}
Output: -bash: WORK: command not found
... or ...
S=${WORKDIR}/SUB DIR
echo ${S}
Output: -bash: DIR: command not found
... as then things end up breaking as they are seen as commands.
It's up to you whether you use them or not; while "..." helps you spare
out on characters in some cases, in other cases not having them
requires you to define an extra variable. Depends on what you prefer...
--
With kind regards,
Tom Wijsman (TomWij)
Gentoo Developer
E-mail address : [email protected]
GPG Public Key : 6D34E57D
GPG Fingerprint : C165 AF18 AB4C 400B C3D2 ABF0 95B2 1FCD 6D34 E57D
signature.asc
Description: PGP signature
