LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] new grep

[ILUG] new grep

Padraig Brady padraig at antefacto.com
Mon Mar 25 17:06:13 GMT 2002


kevin lyda wrote:
> On Mon, Mar 25, 2002 at 04:33:43PM +0000, Padraig Brady wrote:
> 
>>REPVIK OYVIND wrote:
>>
>>>I believe loads of options could be added to both sed and grep. But then it
>>>would no longer follow the KISS principle. That is in my opinion one of the
>>>things that makes *nix so great. 
>>>
>>>sed does it's stuff. Grep does it's stuff. It's as simple as that, no?
>>
>>Well that's exactly my point.
>>Basically all systems should have as high cohesion
>>and as low coupling as possible.
>>I think that sed/grep are quite cohesive
>>and therefore could be merged?
> 
> 
> uh...  i don't use grep to edit files, i use it to search them.  i don't
> use sed to search files, i use it to change them.

Why?

sed -n -e "/[0-9]/p" testfile

is the same as:

grep "[0-9]" testfile

   they're two separate
> activities.

With a common function of finding a pattern.

> grep provides a fast way to search files - and it's simple
> syntax reflects that.  sed has more complex syntax, but it's doing a
> more complex task.

I think it's as easy for someone to learn the p command
in sed, as a seperate grep command. That just takes a
minute or two. The hard bit is understanding the regular
expressions.

Padraig.





More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell