MPE/iX - CI Programming for Stability

July 18, 2008 HP World '01 99
Where is a command”?
PARM cmd=“”, entry=main
# This script finds all occurrences of "cmd" as a UDC, script or program in
# HPPATH. Wildcards are supported for UDC, program and command file
names.
# Note: a cmd name like "foo.sh" is treated as a POSIX name, not a qualified
# MPE name.
if "!entry" = "main" then
errclear
setvar _wh_cmd "!cmd
if delimpos(_wh_cmd,/.") = 1 then
echo WHERE requires the POSIX cmd to be unqualified.
return
endif
# see if the command could be a UDC (wildcards are supported)
setvar _wh_udc_ok (delimpos(_wh_cmd,'._') = 0)
# see if the command could be an MPE filename (wildcards ok, and
# MPE names cannot be qualified at all)
setvar _wh_mpe_ok (delimpos(_wh_cmd,'._') = 0)
## All command values are assumed to be ok as a POSIX filename.
## The dash (-) char is excluded above since it could be in a [a-z] pattern
. . . continued . . .