Re: fgrep,grep and egrep



In article <d8cbd965-3be1-4c65-b97f-b1a17072227a@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Ed Morton <mortonspam@xxxxxxxxx> wrote:
....
I wouldn't bother with fgrep or egrep. If you have to do anything more
complicated than that you may as well learn sed or awk as, with the
exception of a couple of cute GNU grep extensions, their syntax is as
simple as greps for what grep does but they're extensible to do things
grep can't do. The most extensible with the simplest syntax for
anything even moderately complex is awk but sed is also very useful
for simple searching/subsitutions on a single line.

I agree with your general sentiment, and also your recommendation of AWK
(as the best balance between high level and low level). I disagree with
the (tepid) recommendation of sed - I find that once one knows AWK, sed
drops off the radar.

But, having said that, the fact is, this is comp.unix.shell, and one of
the groupthink principles of this newsgroup is that you *should* learn the
plethora of tools (join, comm, pr, sed, etc) and use them all. Also,
all the shell built-ins, like "read", etc.

Finally, my guess at the underlying meaning of the OP is that he is
dealing with existing code and/or a corporate situation where knowing
all these obscure tools is going to be necessary for him to work. I
know that in one of my former jobs, a lot of the existing shell codebase
used all these tools (join, comm, pr, sed, etc) to do things that could
have been done much more easily with a single, unified AWK script. But
ya gotta deal...

--
No, I haven't, that's why I'm asking questions. If you won't help me,
why don't you just go find your lost manhood elsewhere.

CLC in a nutshell.

.



Relevant Pages

  • Re: fgrep,grep and egrep
    ... complicated than that you may as well learn sed or awk as, ... exception of a couple of cute GNU grep extensions, their syntax is as ... simple as greps for what grep does but they're extensible to do things ...
    (comp.unix.shell)
  • Re: General UNIX puzzle
    ... All of those (sed, awk, grep) involve making a copy of the original file ... The gnu shtool is one of the most useful tools for this for in-place ... A Galileo could no more be elected president of the United States than ...
    (freebsd-questions)
  • Re: ssh and chroot
    ... ++ echo /bin/mkdir ... ++ awk '' ... ++ grep '^/' ...
    (comp.security.ssh)
  • Re: The smartest band in the world?
    ... I mainly use grep, but I'm ... going to learn awk and sed and improve my bash scripting. ... Oracle accreditation coure, well in the grad courses at least, everything ...
    (alt.guitar)
  • Re: Difference between Cygwin and DOS handling of string input
    ... Ton of userland tools that make work possible (perl, sed, awk, grep, ... cmd.exe is a shell in that it's a TTY that lets you run commands, ...
    (comp.lang.c)