MPE CI Programming for 7.5
July 22, 2008
Page 71
hp e3000
strategy
CI grep
• PARM pattern, file, entry=main
# This script implements unix $grep -in <pattern> <file>.
setvar savecpu hpcpumsecs
if '!entry' = 'main' then
errclear
setvar _grep_matches 0
if not finfo('!file','exists') then
echo File "!file" not found.
return
endif
continue
xeq !HPFILE !pattern !file entry=read_match <!file
echo ![hpcpumsecs-savecpu] msecs …
echo !_grep_eof records read -- !_grep_matches lines match "!pattern”
deletevar _grep_@
return
. . . (continued on next slide)