blob: 6c0757125be6747a8f2181dfe5ef112956c1927f (
plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# z/OS: the ZOS_* variables, computed from MVS control blocks when read.
#
# ZOS_SYSNAME and ZOS_SYSPLEX come from the CVT and the ECVT, ZOS_ASID and
# ZOS_JOBNAME from the running ASCB, and ZOS_RELEASE from __osname().
# sysvar(1) reports the first two independently. The address-space ID and
# the job name belong to this process alone, so two commands can never agree
# on them: their shape is checked instead.
command -v sysvar >/dev/null 2>&1 || exit 77
for v in SYSNAME SYSPLEX; do
eval "value=\$ZOS_$v"
if [ "$value" = "$(sysvar "$v")" ]; then
echo "$v agrees with sysvar"
else
echo "$v differs: '$value'"
fi
done
if [ "${#ZOS_JOBNAME}" -ge 1 ] && [ "${#ZOS_JOBNAME}" -le 8 ]; then
echo "jobname: 1 to 8 characters"
else
echo "jobname: '$ZOS_JOBNAME'"
fi
case $ZOS_RELEASE in
[0-9][0-9].[0-9][0-9].[0-9][0-9]) echo "release: two digits per field" ;;
*) echo "release: shape '$ZOS_RELEASE'" ;;
esac
case $ZOS_ASID in
[0-9A-F][0-9A-F][0-9A-F][0-9A-F]) echo "asid: four hex digits" ;;
*) echo "asid: shape '$ZOS_ASID'" ;;
esac
# They are read on demand, so they are not in the environment, and a
# ZOS_SYSNAME handed in by a parent cannot outrank the one the shell
# computes for itself.
env | grep -q '^ZOS_' && echo "exported" || echo "not exported"
if [ "$(ZOS_SYSNAME=WRONG "$TSH" -c 'echo "$ZOS_SYSNAME"')" = "$ZOS_SYSNAME" ]; then
echo "inherited: ignored"
else
echo "inherited: kept"
fi
|