Another annoyance

Minor addendum: That works from a Windows command line. In *nix you need to put "*.lib" in quotes, because the wildcard expansion happens before the command is called.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics

160 North State Road #203
Briarcliff Manor NY 10510
845-480-2058

hobbs at electrooptical dot net
http://electrooptical.net
Reply to
Phil Hobbs
Loading thread data ...

AIUA you need the cygwin command line to use $(...) , so you're going to need quotes, unless you're someplace (cwd) where *.lib aint.

--
?? 100% natural

--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net
Reply to
Jasen Betts

If you don't want to go full Cygwin, there's this:

formatting link

I don't know who people live without grep, xargs and find. In Windows,you have to say:

set U=c:\UnixUtils\bin

%U%\find . -name "*.c" | xargs grep pattern

because the shell defaults to the infernal internal "find" thing and you can't override it nor can you delete it.

-- Les Cargill

Reply to
Les Cargill

No updates since 2003.

I use:

One down side is that I have to dig through a mess of packages and install just what I need.

Worse, some packages are incompatible with others. Fortunately, the basic commands (usually) work well.

Ummmm....

SUBST U: C:\UNIXUTILS\BIN SET PATH=C:\UNIXUTILS\BIN;%PATH% (optional) U:\find / start_dir -name "*.c" -print | xargs grep search_pattern

Huh? find is an external command not found in the sh, bash, ksh, command, or cmd shell. C:\windoze\system32\find.exe is supplied with Windoze as an external program. I agree that it sucks.

--
Jeff Liebermann     jeffl@cruzio.com
150 Felker St #D    http://www.LearnByDestroying.com
Santa Cruz CA 95060 http://802.11junk.com
Skype: JeffLiebermann     AE6KS    831-336-2558
Reply to
Jeff Liebermann

There's a unix 'find' as well. To get more or less the function of DOS/Win 'dir', you can go e.g.

'find . -ls -iname "pattern"'

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics

160 North State Road #203
Briarcliff Manor NY 10510
845-480-2058

hobbs at electrooptical dot net
http://electrooptical.net
Reply to
Phil Hobbs

For those that want to stay with the stock Microsoft DOS commands, you can sorta search for a file using:

start -> run -> cmd cd \start_directory dir /s/b search_criteria

This will recurse through the various directories under C:\start_directory and list anything that matches the search_criteria. Unfortunately, the DOS shell (command or cmd) does not impliment the full regex (regular expression) expansion. That means one can NOT use search criteria such as: *junk*.c or any *.c filename with the word "junk" included. The best one can do is: junk*.c which is any filename starting with the word "junk". Still, it's useful for crude searches when other utilties are not available.

--
Jeff Liebermann     jeffl@cruzio.com
150 Felker St #D    http://www.LearnByDestroying.com
Santa Cruz CA 95060 http://802.11junk.com
Skype: JeffLiebermann     AE6KS    831-336-2558
Reply to
Jeff Liebermann

I think that changed at some point--leading splats work for me.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics

160 North State Road #203
Briarcliff Manor NY 10510
845-480-2058

hobbs at electrooptical dot net
http://electrooptical.net
Reply to
Phil Hobbs

Oops, you're right. I just tried it with XP and it works as you describe. It certainly wasn't like that in Windoze 95/98/ME but apparently it was fixed in XP and beyond. Of course, I never noticed until today. Thanks.

--
Jeff Liebermann     jeffl@cruzio.com
150 Felker St #D    http://www.LearnByDestroying.com
Santa Cruz CA 95060 http://802.11junk.com
Skype: JeffLiebermann     AE6KS    831-336-2558
Reply to
Jeff Liebermann

No Eunuchs here ;-) ...Jim Thompson

--
| James E.Thompson, CTO                            |    mens     |
| Analog Innovations, Inc.                         |     et      |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| Phoenix, Arizona  85048    Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |
             
I love to cook with wine.     Sometimes I even put it in the food.
Reply to
Jim Thompson

There are a number of versions of GREP for Win out there but none AFAICT are free. I'm thinking about springing for one but I'd rather not comparison shop when it costs real $$.

Reply to
krw

Yeah, it's finished :)

Right! I put up the URL to show another option.

That works, too.

"The shell" I referred to is c:\windoze\system32\cmd.exe

-- Les Cargill

Reply to
Les Cargill

People have pointed to three separate free ones in this thread alone.

-- Les Cargill

Reply to
Les Cargill

Plenty of free grep tools available.

?????

Shareware $30.

and probably a dozen more.

Note: For the Unix challenged out there, the Windoze "find" command is a cut down mutation of the Unix "grep" command, and has nothing to do with the Unix "find" command which searches for filenames.

--
Jeff Liebermann     jeffl@cruzio.com
150 Felker St #D    http://www.LearnByDestroying.com
Santa Cruz CA 95060 http://802.11junk.com
Skype: JeffLiebermann     AE6KS    831-336-2558
Reply to
Jeff Liebermann

I saw them after I'd posted.

Reply to
krw

Bollocks. ;)

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics

160 North State Road #203
Briarcliff Manor NY 10510
845-480-2058

hobbs at electrooptical dot net
http://electrooptical.net
Reply to
Phil Hobbs

Yes! Lots of those are on this newsgroup ;-) ...Jim Thompson

--
| James E.Thompson, CTO                            |    mens     |
| Analog Innovations, Inc.                         |     et      |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| Phoenix, Arizona  85048    Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |
             
I love to cook with wine.     Sometimes I even put it in the food.
Reply to
Jim Thompson

\*\.lib will do.

I prefer backslash quoting to '" quotes. Single and double quotes have different meanings, BTW. I can never remember which does what.

--
"For a successful technology, reality must take precedence 
over public relations, for nature cannot be fooled."
                                       (Richard Feynman)
Reply to
Fred Abse

Find is extremely powerful. It will conditionally execute commands on files, and much else.

It takes longer to fathom the syntax from the man page than it would to just do the whole thing manually ;-)

OK for regular users, occasional users not so good.

--
"For a successful technology, reality must take precedence 
over public relations, for nature cannot be fooled."
                                       (Richard Feynman)
Reply to
Fred Abse

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.