summary refs log tree commit diff
path: root/bin/cash/tests/expansion/set-u1.0
blob: 39f7e175432f909dd510d13ff9b41021f47e98c6 (plain) (blame)
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
# $FreeBSD: releng/12.0/bin/sh/tests/expansion/set-u1.0 213738 2010-10-12 18:20:38Z obrien $

${SH} -uc 'unset foo; echo $foo' 2>/dev/null && exit 1
${SH} -uc 'foo=; echo $foo' >/dev/null || exit 1
${SH} -uc 'foo=1; echo $foo' >/dev/null || exit 1
# -/+/= are unaffected by set -u
${SH} -uc 'unset foo; echo ${foo-}' >/dev/null || exit 1
${SH} -uc 'unset foo; echo ${foo+}' >/dev/null || exit 1
${SH} -uc 'unset foo; echo ${foo=}' >/dev/null || exit 1
# length/trimming are affected
${SH} -uc 'unset foo; echo ${#foo}' 2>/dev/null && exit 1
${SH} -uc 'foo=; echo ${#foo}' >/dev/null || exit 1
${SH} -uc 'unset foo; echo ${foo#?}' 2>/dev/null && exit 1
${SH} -uc 'foo=1; echo ${foo#?}' >/dev/null || exit 1
${SH} -uc 'unset foo; echo ${foo##?}' 2>/dev/null && exit 1
${SH} -uc 'foo=1; echo ${foo##?}' >/dev/null || exit 1
${SH} -uc 'unset foo; echo ${foo%?}' 2>/dev/null && exit 1
${SH} -uc 'foo=1; echo ${foo%?}' >/dev/null || exit 1
${SH} -uc 'unset foo; echo ${foo%%?}' 2>/dev/null && exit 1
${SH} -uc 'foo=1; echo ${foo%%?}' >/dev/null || exit 1

${SH} -uc 'echo $!' 2>/dev/null && exit 1
${SH} -uc ':& echo $!' >/dev/null || exit 1
${SH} -uc 'echo $#' >/dev/null || exit 1
${SH} -uc 'echo $1' 2>/dev/null && exit 1
${SH} -uc 'echo $1' ${SH} x >/dev/null || exit 1
${SH} -uc 'echo $2' ${SH} x 2>/dev/null && exit 1
${SH} -uc 'echo $2' ${SH} x y >/dev/null || exit 1
exit 0
98979a60087708fb0&follow=1'>Use PascalCase for constants in gfxJune McEnroe 2018-09-02Use PascalCase for constantsJune McEnroe Get outta here, underscores. 2018-09-02Remove colorcolumn at 100June McEnroe 2018-09-02Install bc(1) on ArchJune McEnroe 2018-09-02SendEnv LANGJune McEnroe 2018-08-27Add New Order — TemptationJune McEnroe 2018-08-26Add NetBSD to install.shJune McEnroe 2018-08-24Show hostname in title over SSHJune McEnroe 2018-08-23Alias bc='bc -l'June McEnroe 2018-08-20Update usage of scheme in READMEJune McEnroe 2018-08-20Use scheme.h in fbatt and fbclockJune McEnroe 2018-08-20Generate scheme.hJune McEnroe 2018-08-20Add dependencies on gfx.hJune McEnroe 2018-08-18Add Blondie — Heart of GlassJune McEnroe Why didn't I know about this song? I love it. 2018-08-18Set FCEDIT=$EDITORJune McEnroe 2018-08-18Only post commits with bodies to MastodonJune McEnroe 2018-08-18Run tf/cfg link script with /bin/shJune McEnroe 2018-08-18Run {,s,t}up with /bin/shJune McEnroe 2018-08-18Use whence instead of typeJune McEnroe type is an alias for whence -v and is more for human consumption. 2018-08-18Cut off path components until right prompt fitsJune McEnroe Keeps paths valid (from somehwere) rather than abrupt truncation. 2018-08-17Add "private" alias to source encrypted fileJune McEnroe Why is there no easy way to *edit* an encrypted file? 2018-08-17Add vim mapping to add a #includeJune McEnroe