]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - tools/regression/bin/sh/expansion/set-u1.0
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / tools / regression / bin / sh / expansion / set-u1.0
1 # $FreeBSD$
2
3 sh -uc 'unset foo; echo $foo' 2>/dev/null && exit 1
4 sh -uc 'foo=; echo $foo' >/dev/null || exit 1
5 sh -uc 'foo=1; echo $foo' >/dev/null || exit 1
6 # -/+/= are unaffected by set -u
7 sh -uc 'unset foo; echo ${foo-}' >/dev/null || exit 1
8 sh -uc 'unset foo; echo ${foo+}' >/dev/null || exit 1
9 sh -uc 'unset foo; echo ${foo=}' >/dev/null || exit 1
10 # length/trimming are affected
11 sh -uc 'unset foo; echo ${#foo}' 2>/dev/null && exit 1
12 sh -uc 'foo=; echo ${#foo}' >/dev/null || exit 1
13 sh -uc 'unset foo; echo ${foo#?}' 2>/dev/null && exit 1
14 sh -uc 'foo=1; echo ${foo#?}' >/dev/null || exit 1
15 sh -uc 'unset foo; echo ${foo##?}' 2>/dev/null && exit 1
16 sh -uc 'foo=1; echo ${foo##?}' >/dev/null || exit 1
17 sh -uc 'unset foo; echo ${foo%?}' 2>/dev/null && exit 1
18 sh -uc 'foo=1; echo ${foo%?}' >/dev/null || exit 1
19 sh -uc 'unset foo; echo ${foo%%?}' 2>/dev/null && exit 1
20 sh -uc 'foo=1; echo ${foo%%?}' >/dev/null || exit 1
21
22 sh -uc 'echo $!' 2>/dev/null && exit 1
23 sh -uc ':& echo $!' >/dev/null || exit 1
24 sh -uc 'echo $#' >/dev/null || exit 1
25 sh -uc 'echo $1' 2>/dev/null && exit 1
26 sh -uc 'echo $1' sh x >/dev/null || exit 1
27 sh -uc 'echo $2' sh x 2>/dev/null && exit 1
28 sh -uc 'echo $2' sh x y >/dev/null || exit 1
29 exit 0