]>
Commit | Line | Data |
---|---|---|
254f12f7 | 1 | # $FreeBSD: head/bin/sh/tests/builtins/var-assign.0 327281 2017-12-28 08:22:26Z eadler $ |
71aad674 A |
2 | IFS=, |
3 | ||
4 | SPECIAL="break,\ | |
5 | :,\ | |
6 | continue,\ | |
7 | . /dev/null, | |
8 | eval, | |
9 | exec, | |
10 | export -p, | |
11 | readonly -p, | |
12 | set, | |
13 | shift 0, | |
14 | times, | |
15 | trap, | |
16 | unset foo" | |
17 | ||
18 | UTILS="alias,\ | |
19 | bg,\ | |
20 | bind,\ | |
21 | cd,\ | |
22 | command echo,\ | |
23 | echo,\ | |
24 | false,\ | |
25 | fc -l,\ | |
26 | fg,\ | |
27 | getopts a var,\ | |
28 | hash,\ | |
29 | jobs,\ | |
30 | printf a,\ | |
31 | pwd,\ | |
32 | read var < /dev/null,\ | |
33 | test,\ | |
34 | true,\ | |
35 | type ls,\ | |
36 | ulimit,\ | |
37 | umask,\ | |
38 | unalias -a,\ | |
39 | wait" | |
40 | ||
41 | set -e | |
42 | ||
43 | # For special built-ins variable assignments affect the shell environment. | |
44 | set -- ${SPECIAL} | |
45 | for cmd in "$@" | |
46 | do | |
47 | ${SH} -c "VAR=1; VAR=0 ${cmd}; exit \${VAR}" >/dev/null 2>&1 | |
48 | done | |
49 | ||
254f12f7 | 50 | # For other built-ins and utilities they do not. |
71aad674 A |
51 | set -- ${UTILS} |
52 | for cmd in "$@" | |
53 | do | |
54 | ${SH} -c "VAR=0; VAR=1 ${cmd}; exit \${VAR}" >/dev/null 2>&1 | |
55 | done |