Is there a Unix grep equivalant in DOS?Not natively, but I'm pretty sure someone's written something that does that.
What are you trying to accomplish? Just for the pleasure of it, I want to search for files containing a particular word (or words) of text on the MS-DOS prompt.
Google is your friend.
http://malektips.com/xp_dos_0011.html The DOS command 'QGREP' offers a GREP-like command for Windows XP. With this command you can perform powerful standard and regular expression searches through text files, such as logging and debugging information, similar to what you can do with the UN*X GREP command. QGREP lets you search through one or a multiple of files. (This command requires the Windows 2003 Resource Kit - if you do not have it, read the Windows 2003 Resource Kit download/install instructions. Hey, thanks very much.
That website is currently blocked by my Web filter, but I will surely check it out during lunchtime from the library. You totally rock. Google is still your friend:
http://209.85.165.104/search?q=cache:unRIQX3aWvEJ:malektips.com/xp_dos_0011.html+http://malektips.com/xp_dos_0011.html&hl=en&client=firefox-a&strip=1 http://209.85.165.104/search?q=cache:oT_4ELp_MTwJ:malektips.com/xp_dos_0001.html+http://malektips.com/xp_dos_0001.html&hl=en&client=firefox-a&strip=1 Won't 'find' be sufficient? And is this for MS-DOS or on XP's or Vista's CMD.EXE?
It doesn't do filenames, only their content.
http://www.computerhope.com/findhlp.htm I guess if you need it for scripting, the built-in search functionality wouldn't be of much use. I bet there is some way to tap Vista's search capabilities programagically though. I bet that sort of find would be loads faster, especially if you indexed the files you were searching. > Won't 'find' be sufficient?
Thank you. :-) > And is this for MS-DOS or on XP's or Vista's CMD.EXE? It is for the MS-DOS sub-system (cmd.exe) on XP. MS-DOS went out with the dinosaurs; there is no MS-DOS or DOS prompt in XP. It is called the Windows XP command interpreter, and it is different from MS-DOS with many more features.
If you happen to run an old fashioned DOS program under XP, it runs in an emulated, virtual machine. The grep equivalent on XP is FINDSTR. Give the command FINDSTR /? for details. |
|
|
|
|