Stan (not me) writes:
> Has anyone used the posix "grep" command on MPE/iX to search for a string
> in a group of MPE files? We're stumbling on the hfs/MPE file structure
> crossover.
...
> Please reply also if there's a straight forward way to do this using
> common MPE tools.
<plug>
The MAGNET tool, from Lund Performance Solutions, is a different
approach to the problem. I use both grep and MAGNET, for different
purposes. MAGNET has some ability to be programming-language
aware, so you can say "look for a PASCAL identifier of FOO",
and you won't be shown "FOO_FUM", which is a different identifier.
Also, MAGNET (unlike grep), can handle QEDIT files, and will
also (unlike grep) default to skipping binary files (easily changed).
Example use, looking for the SPL variable yymmdd:
:magnet "[log in to unmask] yymmdd -c -spl -dash"
MAGNET [2.11] - LPS Toolbox [A.01m] (c) 1995 Lund Performance Solutions
DATEPAC.SOURCE.SIELER
06 yymmdd 07 yy/mm/dd 00090000
integer - leap'year (ccyymmdd) 00497000
integer - gregorian'edit (ccyymmdd) 00508000
double - sunday'of (ccyymmdd) 00509000
integer - input'date (chr,ccyymmdd) 00511000
------------------------------------------------------------------------
FINDOLD.SOURCE.SIELER
! 2 : yymmdd__ 00191000
s" 2 : yymmdd" 00551000
! 2 : yymmdd__ 01071000
The "-c" says "case insensitive". The "-dash" says "print a line of
dashes when switching from one "hit file" to the next". (To aid
readability.)
You could also look for instances of numbers, like 1900 and 1970:
:magnet "[log in to unmask] 1900 1970 -w -72 -dash"
FSYSUX.C.SIELER
yy + 1900,
*a_yy = loc_yy - 1900;
(void) ASCII (pyear + 1900, 10, &buf17 [13]);
------------------------------------------------------------------------
NETTIME.C.SIELER
/* between Jan 01, 1900 (net time base) and */
/* Jan 01, 1970 (Unix time base) */
/* and then subtract 1970... */
------------------------------------------------------------------------
The "-72" says "I know that source code often has line numbers...I don't want
you to look past column 72".
The "1900" is a pattern to look for. So is the "1970".
The "-w" says "word oriented", which means 19001 won't be reported, because
that's a different "word" than 1900.
info: [log in to unmask]
</plug>
--
Stan Sieler [log in to unmask]
http://www.allegro.com/sieler.html
|