summaryrefslogtreecommitdiffhomepage
path: root/tests/zos/spawn-env.sh
blob: 665c7af77c7c94a1e8dbfaf9b03545519203559c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# z/OS: the BPX environment variables that steer spawn() must reach the
# child untouched; zash adds no policy of its own.
_BPX_SHAREAS=YES; export _BPX_SHAREAS
/bin/sh -c 'echo "shareas=$_BPX_SHAREAS"'
_BPX_SHAREAS=NO /bin/sh -c 'echo "shareas=$_BPX_SHAREAS"'
/bin/sh -c 'echo "shareas=$_BPX_SHAREAS"'
unset _BPX_SHAREAS
/bin/sh -c 'echo "shareas=[${_BPX_SHAREAS-unset}]"'
_BPX_SPAWN_SCRIPT=YES; export _BPX_SPAWN_SCRIPT
printf '#!/bin/sh\necho "spawned script $1"\n' >s1; chmod +x s1; ./s1 arg
printf 'echo "no magic $1"\n' >s2; chmod +x s2; ./s2 arg
unset _BPX_SPAWN_SCRIPT
./s1 again; ./s2 again
_BPX_BATCH_SPAWN=x /bin/sh -c 'echo "[$_BPX_BATCH_SPAWN]"'
STEPLIB=none /bin/sh -c 'echo "steplib=$STEPLIB"'