shell scripting: grepping multiple patterns, logically ANDed (solved)

Aleksandr Miroslav alexmiroslav at gmail.com
Tue Jul 10 14:23:26 UTC 2012


On Sat, Jun 30, 2012 at 4:23 PM, Giorgos Keramidas
<keramida at ceid.upatras.gr> wrote:
> > Is there an easier/shorter way to do this? If there are 15 arguments
> > supplied on the command line, I don't necessarily want to build 15 if
> > statements.
>
> The solutions proposed so far are ok, if you really *have* to stick to a
> shell script.
[...]
> I'd write this sort of logic in python

Thanks to everyone who responded. I think Giorgos' suggestion to move
away from a shell script was the most elegant one, and I rewrote my
script in Python (plagiarizing most of his code in the meantime) and it
works great.

Ironically, it runs even faster than the /bin/sh + find(1) version,
go figure.

Thanks again,
Alex


More information about the freebsd-questions mailing list