Denis Vlasenko | f886fd2 | 2008-10-13 12:36:05 +0000 | [diff] [blame] | 1 | export a=b |
Denis Vlasenko | d29084d | 2008-10-13 08:54:42 +0000 | [diff] [blame] | 2 | |
| 3 | # external program |
Denis Vlasenko | f886fd2 | 2008-10-13 12:36:05 +0000 | [diff] [blame] | 4 | a=c /bin/true |
Denis Vlasenko | d29084d | 2008-10-13 08:54:42 +0000 | [diff] [blame] | 5 | env | grep ^a= |
| 6 | |
| 7 | # builtin |
Denis Vlasenko | f886fd2 | 2008-10-13 12:36:05 +0000 | [diff] [blame] | 8 | a=d true |
Denis Vlasenko | d29084d | 2008-10-13 08:54:42 +0000 | [diff] [blame] | 9 | env | grep ^a= |
| 10 | |
| 11 | # exec with redirection only |
| 12 | # in bash, this leaks! |
Denis Vlasenko | f886fd2 | 2008-10-13 12:36:05 +0000 | [diff] [blame] | 13 | a=e exec 1>&1 |
Denis Vlasenko | d29084d | 2008-10-13 08:54:42 +0000 | [diff] [blame] | 14 | env | grep ^a= |
| 15 | |
| 16 | echo OK |