1 |
|
2 |
#### Double Quoted |
3 |
|
4 |
two=2 |
5 |
three=3 |
6 |
|
7 |
echo """ |
8 |
one |
9 |
two = $two |
10 |
three = $three |
11 |
""" |
12 |
|
13 |
shopt --set parse_triple_quoted |
14 |
|
15 |
# Now this should be dedented, and I think the first newline doens't count? |
16 |
|
17 |
echo """ |
18 |
one |
19 |
two = $two |
20 |
three = $three |
21 |
""" |
22 |
|
23 |
## STDOUT: |
24 |
|
25 |
one |
26 |
two = 2 |
27 |
three = 3 |
28 |
|
29 |
one |
30 |
two = 2 |
31 |
three = 3 |
32 |
## END |
33 |
|
34 |
|
35 |
#### more |
36 |
|
37 |
echo ''' |
38 |
one |
39 |
two = $two |
40 |
three = $three |
41 |
''' |
42 |
|
43 |
## STDOUT: |
44 |
|
45 |
one |
46 |
two = $two |
47 |
three = $three |
48 |
|
49 |
## END |
50 |
|
51 |
#### here doc with quotes |
52 |
|
53 |
# This has 3 right double quotes |
54 |
|
55 |
cat <<EOF |
56 |
"hello" |
57 |
"" |
58 |
""" |
59 |
EOF |
60 |
|
61 |
|
62 |
## STDOUT: |
63 |
"hello" |
64 |
"" |
65 |
""" |
66 |
## END |
67 |
|
68 |
|