File tree Expand file tree Collapse file tree 1 file changed +21
-4
lines changed
Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Original file line number Diff line number Diff line change 11// Output
2- // ABC
3- // c
42// '
53// ''
4+ // a'b
65// 'ABC'
76// a'bABCc'd
7+ // 'ABC
8+ // ABC'
9+ // '"a'b
10+ // ---
811// '
912// a'b
13+ // 'ABC
14+ // ABC'
1015// a'bABCc'd
1116// "ab
17+ // ---
18+ // ABC
19+ // c
1220
1321const str = "ABC"
1422const space = " "
1523
16- trust $ printf '{str}\\n' $
17- trust $ echo 'a b c d e' | cut -d'{space}' -f3 $
1824echo "'"
1925echo "''"
26+ echo "a'b"
2027echo "'ABC'"
2128echo "a'b{str}c'd"
29+ echo "'{str}"
30+ echo "{str}'"
31+ echo "'\"a'b"
32+ echo "---"
2233trust $ echo "'" $
2334trust $ echo "a'b" $
35+ trust $ echo "'{str}" $
36+ trust $ echo "{str}'" $
2437trust $ echo "a'b{str}c'd" $
2538trust $ echo '"a'b $
39+ echo "---"
40+ // Reallife examples
41+ trust $ printf '{str}\\n' $
42+ trust $ echo 'a b c d e' | cut -d'{space}' -f3 $
You can’t perform that action at this time.
0 commit comments