1 |
On Thu, 29 Aug 2013 10:41:08 +0400 |
2 |
Sergey Popov <pinkbyte@g.o> wrote: |
3 |
|
4 |
> 28.08.2013 20:06, hasufell пишет: |
5 |
> > On 08/28/2013 05:53 PM, "Paweł Hajdan, Jr." wrote: |
6 |
> And if WORKDIR will contain whitespace(s), does this code still be |
7 |
> working? :-) |
8 |
> |
9 |
> // sorry for bikeshedding, can not resist |
10 |
|
11 |
Just try it out ... |
12 |
|
13 |
WORKDIR="SOME WORK DIR" |
14 |
S=${WORKDIR}/SUBDIR |
15 |
echo ${S} |
16 |
|
17 |
Output: SOME WORK DIR/SUBDIR |
18 |
|
19 |
... and you will see that this works. |
20 |
|
21 |
Although on the other hand you can't do ... |
22 |
|
23 |
S=SOME WORK DIR/SUBDIR |
24 |
echo ${S} |
25 |
|
26 |
Output: -bash: WORK: command not found |
27 |
|
28 |
... or ... |
29 |
|
30 |
S=${WORKDIR}/SUB DIR |
31 |
echo ${S} |
32 |
|
33 |
Output: -bash: DIR: command not found |
34 |
|
35 |
... as then things end up breaking as they are seen as commands. |
36 |
|
37 |
It's up to you whether you use them or not; while "..." helps you spare |
38 |
out on characters in some cases, in other cases not having them |
39 |
requires you to define an extra variable. Depends on what you prefer... |
40 |
|
41 |
-- |
42 |
With kind regards, |
43 |
|
44 |
Tom Wijsman (TomWij) |
45 |
Gentoo Developer |
46 |
|
47 |
E-mail address : TomWij@g.o |
48 |
GPG Public Key : 6D34E57D |
49 |
GPG Fingerprint : C165 AF18 AB4C 400B C3D2 ABF0 95B2 1FCD 6D34 E57D |