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.
sed -n -e "/[0-9]/p" testfile
is the same as:
grep "[0-9]" testfile
they're two separate
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
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!