File tree Expand file tree Collapse file tree 2 files changed +34
-12
lines changed
Expand file tree Collapse file tree 2 files changed +34
-12
lines changed Original file line number Diff line number Diff line change 1+ // Single quotes should not disturb interpolation
12// Output
2- // ABC
3- // c
4- // '
5- // ''
6- // 'ABC'
7- // a'bABCc'd
83// '
94// a'b
5+ // 'ABC
6+ // ABC'
107// a'bABCc'd
118// "ab
9+ // ---
10+ // ABC
11+ // c
1212
1313const str = "ABC"
1414const space = " "
1515
16- trust $ printf '{str}\\n' $
17- trust $ echo 'a b c d e' | cut -d'{space}' -f3 $
18- echo "'"
19- echo "''"
20- echo "'ABC'"
21- echo "a'b{str}c'd"
2216trust $ echo "'" $
2317trust $ echo "a'b" $
18+ trust $ echo "'{str}" $
19+ trust $ echo "{str}'" $
2420trust $ echo "a'b{str}c'd" $
2521trust $ echo '"a'b $
22+ echo "---"
23+ // Reallife examples
24+ trust $ printf '{str}\\n' $
25+ trust $ echo 'a b c d e' | cut -d'{space}' -f3 $
Original file line number Diff line number Diff line change 1+ // Single quotes should not disturb interpolation
2+ // Output
3+ // '
4+ // ''
5+ // a'b
6+ // 'ABC'
7+ // a'bABCc'd
8+ // 'ABC
9+ // ABC'
10+ // '"a'b
11+
12+ const str = "ABC"
13+ const space = " "
14+
15+ echo "'"
16+ echo "''"
17+ echo "a'b"
18+ echo "'ABC'"
19+ echo "a'b{str}c'd"
20+ echo "'{str}"
21+ echo "{str}'"
22+ echo "'\"a'b"
You can’t perform that action at this time.
0 commit comments