Bakul Shah <bakul@xxxxxxxxxxxxx> writes: > Is this your only objection?! It seems to me it wouldn't be > hard to add sexp support to grep or even write sexpgrep from > scratch! Example use of such a hypothetical program: I agree. In fact I guess it could be done n less than twenty lines in whatever implementation of Scheme. There are many tools that would need an equivalent sexp-flavour, though. > As you can see, the main problem is figuring out exactly what > to show.... Perhaps it should be the smallest enclosing > context or the smallest enclosing context if the whole line > is shown. As Bruno pointed out, it is less of an issue when structure information is mapped to directory hierarchy rather than to a file. But the file format is bound to change drastically, so I am not discarding any of your considerations. By the way, I just found this: Package: sgrep Description: a tool to search a file for structured pattern Sgrep (structured grep) is a tool for searching text files and filtering text streams for structured criteria. Sgrep implements a query language based on so called region expressions. . Like grep, sgrep can be used for any kind of text files. However it is most useful for text files containing some kind of structured text. A file containing structured text could be defined as a file, which obeys some syntax. Examples of structured text files are SGML, HTML, C, Tex and mail files. > Unix tools such as grep, awk & sed are fine for line oriented > data but they don't handle nest structured data very well. I > believe it wouldn't be too hard to extend exiting tools such > that the record delimiter is a matching pair of parentheses. Mmmh, record delimiter usually define sequential data items, I don't know to what point this is interchangeable with nesting/recursive structures as defined by sexps. Massimiliano