blob: 1bddd870fd3dd58e1cdec4a37f95799e0408ea23 [file] [log] [blame]
Denis Vlasenkof886fd22008-10-13 12:36:05 +00001export a=b
Denis Vlasenkod29084d2008-10-13 08:54:42 +00002
3# external program
Denis Vlasenkof886fd22008-10-13 12:36:05 +00004a=c /bin/true
Denis Vlasenkod29084d2008-10-13 08:54:42 +00005env | grep ^a=
6
7# builtin
Denis Vlasenkof886fd22008-10-13 12:36:05 +00008a=d true
Denis Vlasenkod29084d2008-10-13 08:54:42 +00009env | grep ^a=
10
11# exec with redirection only
12# in bash, this leaks!
Denis Vlasenkof886fd22008-10-13 12:36:05 +000013a=e exec 1>&1
Denis Vlasenkod29084d2008-10-13 08:54:42 +000014env | grep ^a=
15
16echo OK