blob: 42a9cc3a408757bda5a14a71a6763d41abffbd7e (
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
|
# Here-documents.
x=val
cat <<EOF
plain $x `echo bq` $(echo sub) \$x \\ \` "q" 'q'
EOF
cat <<'EOF'
quoted $x `echo bq` \$x
EOF
cat <<"E O F"
spaces in delimiter $x
E O F
cat <<-EOF
tabs stripped $x
two tabs
EOF
cat <<E1; cat <<E2
first
E1
second
E2
cat <<EOF | tr a-z A-Z
piped $x
EOF
f() { cat <<EOF
in function $1
EOF
}
f arg
cat <<EOF
EOF
echo "after empty"
cat <<EOF
line with \
continuation
EOF
while read -r l; do echo "read: $l"; done <<EOF
one
two
EOF
cat <<EOF >out; cat out
to file
EOF
cat <<\EOF
backslash-quoted $x
EOF
y=$(cat <<EOF
in cmdsub $x
EOF
); echo "$y"
cat <<EOF
$((1 + 2)) ${x%l}
EOF
if true; then cat <<EOF
in if
EOF
fi
cat <<EOF
EOFnot the end
EOF
EOF
|