mirror of
https://github.com/opnsense/src.git
synced 2026-02-18 10:08:41 -05:00
This is sometimes used with eval or old-style command substitution, and most shells other than ash derivatives allow it. It can also be used with scripts that violate POSIX's requirement on the application that they end in a newline (scripts must be text files except that line length is unlimited). Example: v=`cat <<EOF foo EOF` echo $v This commit does not add support for the similar construct with new-style command substitution, like v=$(cat <<EOF foo EOF) This continues to require a newline after the terminator.
26 lines
255 B
Text
26 lines
255 B
Text
# $FreeBSD$
|
|
|
|
failures=''
|
|
|
|
check() {
|
|
if eval "[ $* ]"; then
|
|
:
|
|
else
|
|
echo "Failed: $*"
|
|
failures=x$failures
|
|
fi
|
|
}
|
|
|
|
check '`cat <<EOF
|
|
foo
|
|
EOF` = foo'
|
|
|
|
check '"`cat <<EOF
|
|
foo
|
|
EOF`" = foo'
|
|
|
|
check '`eval "cat <<EOF
|
|
foo
|
|
EOF"` = foo'
|
|
|
|
test "x$failures" = x
|