]> git.saurik.com Git - apple/shell_cmds.git/blame - sh/tests/parser/heredoc2.0
shell_cmds-216.60.1.tar.gz
[apple/shell_cmds.git] / sh / tests / parser / heredoc2.0
CommitLineData
deb63bfb 1# $FreeBSD: head/bin/sh/tests/parser/heredoc2.0 211405 2010-08-16 21:14:49Z jilles $
71aad674
A
2
3failures=0
4
5check() {
6 if ! eval "[ $* ]"; then
7 echo "Failed: $*"
8 : $((failures += 1))
9 fi
10}
11
12s='ast*que?non' sq=\' dq=\"
13
14check '"$(cat <<EOF
15${s}
16EOF
17)" = "ast*que?non"'
18
19check '"$(cat <<EOF
20${s+'$sq'x'$sq'}
21EOF
22)" = ${sq}x${sq}'
23
24check '"$(cat <<EOF
25${s#ast}
26EOF
27)" = "*que?non"'
28
29check '"$(cat <<EOF
30${s##"ast"}
31EOF
32)" = "*que?non"'
33
34check '"$(cat <<EOF
35${s##'$sq'ast'$sq'}
36EOF
37)" = "*que?non"'
38
39exit $((failures != 0))