summaryrefslogtreecommitdiffstats
path: root/test/bashisms/heredocs.sh
blob: 39dd076ed86525f87cb1a2e487fa1edf229b9737 (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
#!/bin/sh

cat <<- FOO
    foo
	bar
    moo
FOO

echo -e moo # BASHISM

foo() {
	cat <<- FOO
	foo
	bar
	moo
	FOO
	echo -e BASHISM
}

bar() {
	cat <<- FOO
	foo
	bar
	moo
    FOO
    echo -e nothing wrong here
FOO
	echo -e BASHISM
}


moo() {
	cat << FOO
	foo
	bar
	moo
    FOO
    echo -e nothing wrong here
	FOO
	echo -e still nothing wrong here
FOO
	echo -e BASHISM
}

baz() {
    cat << EOF1
EOF1 
    echo -e still inside the here doc
EOF1 ; echo -e still inside...
EOF1
    echo -e BASHISM
}