-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathhere.yaml
102 lines (88 loc) · 1.83 KB
/
here.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: "Here docs/strings"
cases:
- name: "Basic here doc"
stdin: |
cat <<END-MARKER
Something here...
...and here.
END-MARKER
echo "This is after"
- name: "Basic here doc in a script"
test_files:
- path: "script.sh"
contents: |
cat <<END-MARKER
Something here...
...and here.
END-MARKER
echo "This is after"
args: ["./script.sh"]
- name: "Here doc with expansions"
stdin: |
cat <<END-MARKER
Something here...
...and here.
$(echo "This is after")
END-MARKER
- name: "Here doc with expansions but quoted tag"
stdin: |
cat <<"END-MARKER"
Something here...
...and here.
$(echo "This is after")
END-MARKER
- name: "Here doc with tab removal"
stdin: |
cat <<-END-MARKER
Something here...
...and here.
END-MARKER
- name: "Basic here string"
stdin: |
shopt -ou posix
cat <<<"Something here."
wc -l <<<"Something"
- name: "Empty here doc"
stdin: |
wc -l <<EOF
EOF
- name: "Here doc with other tokens after tag"
stdin: |
wc -l <<EOF | wc -l
A B C
1 2 3
EOF
- name: "Multiple here docs"
stdin: |
cat <<EOF1 <<EOF2
A B C
EOF1
1 2 3
EOF2
- name: "Here doc in a command substitution"
stdin: |
test1=$(cat <<EOF
1
2 3
4 5 6
EOF
)
echo "${test1}"
- name: "Multiple here docs in a command substitution"
stdin: |
test1=$(cat <<EOF1 <<EOF2
A B C
EOF1
D E F
EOF2
)
echo "${test1}"
- name: "Complex here docs in a command substitution"
stdin: |
test1=$(cat <<EOF1 <<EOF2 | wc -l
A B C
EOF1
D E F
EOF2
)
echo "${test1}"