blob: 9e24db6ea6417bca09120138fd7561fb2a40741b (
plain)
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
|
seq() { awk "BEGIN { for (i = $1; i <= $2; i++) print i }"; }
x=val
cat <<EOF
plain $x $(echo cmd) $((1+1)) `echo bq`
indented \$x \\ \` "quotes" 'single'
EOF
cat <<'EOF'
quoted $x $(echo cmd) \n
EOF
cat <<\EOF
bs $x
EOF
cat <<-EOF
tabbed $x
two
EOF
cat <<"E O F"
spaced delim $x
E O F
cat <<A; cat <<B
first
A
second
B
cat <<EOF | tr a-z A-Z
upper
EOF
while read l; do echo "[$l]"; done <<EOF
l1
l2
EOF
f() { cat <<EOF
in function $1
EOF
}
f arg
cat <<EOF
line\
continued
EOF
cat <<EOF
blank above
EOF
if true; then cat <<EOF
in if
EOF
fi
x=$(cat <<EOF
in cmdsub
EOF
)
echo "$x"
cat <<EOF >out; cat out
to file
EOF
cat <<EOF
$x
"$x"
'$x'
EOF
cat <<EOF
$(echo "a
b")
EOF
big=$(seq 1 3000)
cat <<EOF | wc -l | tr -d ' '
$big
EOF
cat <<EOF && echo after-and
and-list
EOF
cat <<'E1' <<'E2'
one (ignored)
E1
two (wins)
E2
cat <<EOF
unterminated is ok at end of file
|