I always forget the syntax of command-line tools for searching through multiple files. What's the easiest/fastest way to search through, say, all of the .sty files distributed in TeX Live for the occurrence of a string, say, \everypar? (Let's assume Linux/Mac OS X.)
| |||
|
show 2 more comments
feedback
|
|
I'm using a script called
backslashes should be quoted. Here's the source of the script: Search pattern:
It's valuable for me because I like to read sources and this saves me time. I've put the script on my blog some time ago: Speed up the work by shell scripts. More scripts related to search & work: Search and edit:
Search and look around:
Search and change to directory:
All could be done by shell functions instead of scripts. Like Michael suggested in my blog:
I hope it's useful for somebody, even though it goes beyond the question. | |||
feedback
|
|
This is what I do:
has really nice output (and a TextMate bundle as well - but that's not the question) and is quite fast. Make sure you've got everything you need in the
(you should also include | |||||||||
feedback
|
|
Well, my command lines tend to be quite verbose, but I think you could search for all occurances of
Now that I've had my morning vat o' coffee (and read some comments), a more concise version would be:
| ||||
|
feedback
|
|
It is slightly easier for ConTeXt. Just enter your search phrase in the search box here | |||
|
feedback
|
findis your friend here. – Juan A. Navarro Oct 13 '10 at 14:50grep -r --include=*.sty "\\everypar" <DIR>(Need to escape the backslash.) – Willie Wong Oct 13 '10 at 15:28