Re: asm grep
- From: Herbert Kleebauer <klee@xxxxxxxxx>
- Date: Sun, 30 Dec 2007 18:28:28 +0100
Frank Kotler wrote:
Definitely! Without functionality, we can make it *real* small and
*real* fast! :) We need it to work a *little* like "real grep", at
least. Question is, how cheap can we get it...
Maybe it would be better to make it *little* like "real MSDOS find"
instead of grep. There surely is a reason why much more people use
"find" than "grep". A powerful tool is only powerful when used by
a power user, in the hands of a novice a simple tool is much more
productive.
Before starting with the implementation a specification has
to be made. I think the first decision which has to be made is:
should the tool be used with text or binary files (it is maybe
better to use different tools and not combine it in one like
with grep).
Supposedly you want a text search tool (otherwise the term
"line" doesn't make any sense). The next question is, which
features are absolutely necessary, which one are desirable
and which one are so rarely used so that they only make
the usage complicated without a notable practical improvement
for a novice user.
The next task is to separate the desirable features into
a group which easily can be implemented and a group which
would be to much effort to implement.
RFC for a simple text line based find utility:
=============================================
findt "search string" <infile >outfile
Display all lines containing "search string"
or
findt - "search string" <infile >outfile
Display all lines not containing "search string"
- findt only reads stdin and writes to stdout, no filename is
given. This way the OS is responsibly for correctly open
the files (eliminates the problem when using long file
names or file names with spaces in 16 bit DOS programs).
This way it is easier to make the utility OS independent.
- The search string is case insensitive for lower case letters
and case sensitive for upper case letters. This allows a
case insensitive search and some letter by letter case
sensitive search without using complicated options.
- The only letters which are not allowed within "search string"
are " ? and $. Any character can be included by using it's hex
value (for example $22 for " or $24 for $ or $3f for ?). A ?
within the search string matches any character in the input stream.
- Because the search is line based, a "$0asearch string" will only
match if 'search string' is at the beginning of the line and a
"search string$0d" (for DOS) or "search string$0a" (for Linux)
will only match if 'search string' is at the end of the line.
The input file is internally prefixed and and postfixed by
a new line character so this also works for the first and
last line.
- To simplify implementation, the search string is limited to
128 characters and the line length of the input file is limited
to 4k (64k?). If a line is longer than 4 k a line wrap is
automatically inserted (even if this splits a valid search
string).
-???????
.
- Follow-Ups:
- Re: asm grep
- From: Rod Pemberton
- Re: asm grep
- References:
- asm grep
- From: Frank Kotler
- Re: asm grep
- From: Robert Redelmeier
- Re: asm grep
- From: Frank Kotler
- Re: asm grep
- From: Robert Redelmeier
- Re: asm grep
- From: Charles Crayne
- Re: asm grep
- From: Frank Kotler
- Re: asm grep
- From: Robert Redelmeier
- Re: asm grep
- From: Charles Crayne
- Re: asm grep
- From: Robert Redelmeier
- Re: asm grep
- From: Frank Kotler
- Re: asm grep
- From: Robert Redelmeier
- Re: asm grep
- From: Frank Kotler
- Re: asm grep
- From: Rod Pemberton
- Re: asm grep
- From: Frank Kotler
- asm grep
- Prev by Date: Re: Mem under Linux
- Next by Date: asm basic calculator
- Previous by thread: Re: asm grep
- Next by thread: Re: asm grep
- Index(es):
Relevant Pages
|