mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Linux

Reply
 
Thread Tools
Old 2010-09-21, 17:19   #1
Uncwilly
6809 > 6502
 
Uncwilly's Avatar
 
"""""""""""""""""""
Aug 2003
101×103 Posts

100000000001012 Posts
Default Recommended GREP for windows?

At work, my machine runs windows (can't change that). I could really benefit from the functionality of grep on a certain project (repetative find and replaces over a group of files) . I don't have admin rights on the PC. I would like to find a free grep for windows that can live outside of ProgramFiles (so that I can try it out.) If it works out ok, I can petition to have it properly installed.

Does anyone have any recommendations? I have looked at a few of the top hits on our fav search engine.
Uncwilly is offline   Reply With Quote
Old 2010-09-21, 17:52   #2
kar_bon
 
kar_bon's Avatar
 
Mar 2006
Germany

28·11 Posts
Default

The GNU utilities for Win32 cotain command line versions of egrep.exe, fgrep.exe and grep.exe. Try "grep --help" for more info.
kar_bon is offline   Reply With Quote
Old 2010-09-21, 20:34   #3
Uncwilly
6809 > 6502
 
Uncwilly's Avatar
 
"""""""""""""""""""
Aug 2003
101×103 Posts

7×1,171 Posts
Default

Thanks for that pointer. I think that will now be on my home machine....

I found Notepad++ I have tried it and it seems to work well for one thing that I really wanted, multiline find and replace. I can highlight the text and replace all occurances in whateever file type in a directory. I parked it in a temp folder (it can live on a USB drive).

Free
Does not have to be in Program Files
Does not nee to write to registry
Multiline find and replace √√
Multifile actions
Commandline driven Χ

Overall a big win.
Uncwilly is offline   Reply With Quote
Old 2010-09-21, 23:23   #4
cmd
 
cmd's Avatar
 
"(^r'°:.:)^n;e'e"
Nov 2008
;t:.:;^

3E716 Posts
Default

Will, you kindly help us with "regular expressions"
(search and replace) ?

search .
Replace &\t

start
01f
result
0\t1\tf



( \t = tab )

( & | $ ) not working properly

(Thanks)

Last fiddled with by cmd on 2010-09-21 at 23:26 Reason: help
cmd is offline   Reply With Quote
Old 2010-09-22, 02:12   #5
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

22×881 Posts
Default

You an also install MinGW and Msys, which will give you a complete unix environment without touching the registry. If you put the path to the MinGW and Msys binaries in your environment then you can also use a large number of common text utilities from the windows command prompt.

By the way, to do an automated search and replace over multiple files I find 'sed' is more useful.
jasonp is offline   Reply With Quote
Old 2010-09-22, 08:03   #6
Chris Card
 
Chris Card's Avatar
 
Aug 2004

100000012 Posts
Default

I take it people have a downer on Cygwin for some reason? (perhaps because it writes to the registry?).

Chris
Chris Card is offline   Reply With Quote
Old 2010-09-22, 08:26   #7
xilman
Bamboozled!
 
xilman's Avatar
 
May 2003
Down not across

10,069 Posts
Default

Quote:
Originally Posted by Chris Card View Post
I take it people have a downer on Cygwin for some reason? (perhaps because it writes to the registry?).

Chris
I have a downer on it because it is GPL licensed. To be able to redistribute binaries their sources must also be redistributed under the GPL. If the source is Free but not GPL (BSD for instance) you can't send anyone a binary.


Paul
xilman is offline   Reply With Quote
Old 2010-09-22, 10:34   #8
Chris Card
 
Chris Card's Avatar
 
Aug 2004

3×43 Posts
Default

Quote:
Originally Posted by xilman View Post
I have a downer on it because it is GPL licensed. To be able to redistribute binaries their sources must also be redistributed under the GPL. If the source is Free but not GPL (BSD for instance) you can't send anyone a binary.


Paul
I understand, but the original question was about grep.

Chris
Chris Card is offline   Reply With Quote
Old 2010-09-22, 12:41   #9
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

22·881 Posts
Default

Cygwin reproduces a posix environment much more faithfully than MinGW does, which means its various pieces are integrated together much more tightly than I'd like. At least twice now, I've had to install new versions of packages I've needed, but if the cygwin install is more than a year old then nothing will work unless I throw it all away and get the latest version of everything. Not that something basic like grep would have that problem, but it's a pain to need version of X+1 of something and then put everything on hold while cygwin reinstalls.

Another problem I've noticed is that installing packages in cygwin requires the ability to run cygwin install scripts, which means you have to use their setup utility to run everything and track down dependencies. With MinGW you just unzip the new package into your current install. Using the setup utility means needing network access for it to get all the packages it needs; that sounds like a no-brainer, until you have to install cygwin on a machine with no or restricted network access. What can you do then, put a whole cygwin mirror on a DVD?

Last fiddled with by jasonp on 2010-09-22 at 13:37
jasonp is offline   Reply With Quote
Old 2010-09-22, 14:45   #10
Chris Card
 
Chris Card's Avatar
 
Aug 2004

3×43 Posts
Default

Quote:
Originally Posted by jasonp View Post
Cygwin reproduces a posix environment much more faithfully than MinGW does, which means its various pieces are integrated together much more tightly than I'd like. At least twice now, I've had to install new versions of packages I've needed, but if the cygwin install is more than a year old then nothing will work unless I throw it all away and get the latest version of everything. Not that something basic like grep would have that problem, but it's a pain to need version of X+1 of something and then put everything on hold while cygwin reinstalls.

Another problem I've noticed is that installing packages in cygwin requires the ability to run cygwin install scripts, which means you have to use their setup utility to run everything and track down dependencies. With MinGW you just unzip the new package into your current install. Using the setup utility means needing network access for it to get all the packages it needs; that sounds like a no-brainer, until you have to install cygwin on a machine with no or restricted network access. What can you do then, put a whole cygwin mirror on a DVD?
On the other hand, I've found it much easier to set up a development environment with Cygwin (though to be honest I now tend to run Fedora as a VirtualBox guest). I don't remember having to reinstall everything, though the cygwin dlls do change from time-to-time.

Chris
Chris Card is offline   Reply With Quote
Old 2010-09-22, 15:03   #11
Uncwilly
6809 > 6502
 
Uncwilly's Avatar
 
"""""""""""""""""""
Aug 2003
101×103 Posts

7·1,171 Posts
Default

Quote:
Originally Posted by Chris Card View Post
I take it people have a downer on Cygwin for some reason? (perhaps because it writes to the registry?).


But that is ok. The original need has been filled.
Uncwilly is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
GTX 1080 ... which is recommended... petrw1 GPU Computing 27 2017-12-14 14:54
Recommended GTX 760 clockspeed? UBR47K GPU Computing 6 2015-12-20 17:22
Current recommended TF bit depth? endless mike GPU Computing 3 2015-08-07 23:00
Some recommended sequences schickel Aliquot Sequences 7 2009-07-25 10:00
Recommended TF bit levels for M(>10^8) NBtarheel_33 Math 19 2008-11-03 17:19

All times are UTC. The time now is 03:47.

Sat Jul 4 03:47:23 UTC 2020 up 101 days, 1:20, 1 user, load averages: 1.18, 1.19, 1.20

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.