In addition to $ bg_printenv -o ustate -r -c, there's also the
environment selector so that you can use something like this in
shell scripts, at least getting rid of the | grep:
for env in 0 1; do
eval "$(bg_printenv -o ustate -p $env --raw)"
case $USTATE in
0)
echo "OK"
;;
... whatever ...
esac
done
However, it's still (too much) pluming IMO. What about one bg_printenv
call that returns the values from *all* environments, e.g., [mockup]
$ bg_printenv -o ustate -p all --raw
ENV_COUNT=2
USTATE_0=0
USTATE_1=3
where the _<NUM> suffix is the config partition number and ENV_COUNT
gives the total config partition count? Otherwise, you have to know
or probe for the config partition count...
Kind regards,
Christian
--
Dr. Christian Storm
Siemens AG, Technology, T CED SES-DE
Otto-Hahn-Ring 6, 81739 München, Germany