MPE/iX - CI Programming for Stability

July 18, 2008 HP World '01 96
Scan history (redo) stack
PARM cmdstr entry=main
# Script scans the redo stack, from top-of-stack (TOS), backwards towards the
# beginning, searching for the 1st cmd line that contains "cmdstr“ anywhere.
if '!entry' = 'main' then
listredo ;unn >lrtmp
# create variables for each command line in the redo stack
xeq !hpfile "!cmdstr" entry='listredo' <lrtmp
# scan above variables for first match on "cmdstr“
xeq !hpfile "!cmdstr" entry='match
# match or not?
if _rdo_line = "" then
echo "!cmdstr" not found in history stack.
else
# do an interactive command redo feature
echo Edit command line for REDO:
echo !_rdo_line
setvar _rdo_edit input()
while _rdo_edit <> "" do
setvar _rdo_line edit(_rdo_line,_rdo_edit)
echo !_rdo_line
setvar _rdo_edit input()
endwhile
# execute the command
continue
!_rdo_line
endif
deletevar _rdo_@
return