Date: Tue, 10 Jul 2012 10:23:25 -0400 From: Aleksandr Miroslav <alexmiroslav@gmail.com> To: freebsd-questions@freebsd.org Subject: Re: shell scripting: grepping multiple patterns, logically ANDed (solved) Message-ID: <CACcSE1wRgtaf-p0_ne6A_jK4Ap%2BWWozUfi_kr-DS0jc22Cjtiw@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
On Sat, Jun 30, 2012 at 4:23 PM, Giorgos Keramidas <keramida@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACcSE1wRgtaf-p0_ne6A_jK4Ap%2BWWozUfi_kr-DS0jc22Cjtiw>