Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > alt.os.linux.debian > #8420
| From | Dan Purgert <dan@djph.net> |
|---|---|
| Newsgroups | alt.os.linux.debian |
| Subject | Re: Simple script fools me? |
| Date | 2016-09-29 18:16 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <slrnnuqmgo.78j.dan@xps-linux.djph.net> (permalink) |
| References | <nsivjc$ckm$1@dont-email.me> <nsj70m$4vp$1@dont-email.me> <slrnnuq8ja.78j.dan@xps-linux.djph.net> <nsjcun$sj3$1@dont-email.me> |
William Unruh wrote: > On 2016-09-29, Dan Purgert <dan@djph.net> wrote: >> >> William Unruh wrote: >>> On 2016-09-29, dog@gmail.com <dog@gmail.com> wrote: >>>> Simple script fools me? >>>> >>>> #!/bin/bash >>>> echo -n " find files here containing PHRASE: " >>>> echo $1 >>>> find . -type f | \ >>>> grep -v pdf | \ >>>> grep -v wav | \ >>>> grep -v mp3 | \ >>>> xargs grep -l "$1" | grep -v grep >>>> exit. >>> >>> Uh, why not just >>> grep -r -l "$1" . >>> instead of all those grep phrases? >>> YOu could then filter out all those files you do not want. >>> >>> grep -r -l "$1" 2>/dev/null |egrep -v 'pdf$|wav$|mp3$' >> >> or, >> find . -type f -name "$1" (or *$1*) | egrep -v 'pdf|wav|mp3' > > That will throw away files called tidalwave.txt which the user might > want to actually save-- you want the pdf, wav, mp3 to be at the end of > the filename I assume. > Also, in his script, $1 was in the content of the file not the name > of the file. *sigh* been a long day, and it's barely even half over ... -- |_|O|_| Registered Linux user #585947 |_|_|O| Github: https://github.com/dpurgert |O|O|O| PGP: 05CA 9A50 3F2E 1335 4DC5 4AEE 8E11 DDF3 1279 A281
Back to alt.os.linux.debian | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Simple script fools me? dog@gmail.com - 2016-09-29 11:57 +0000
Re: Simple script fools me? William Unruh <unruh@invalid.ca> - 2016-09-29 14:04 +0000
Re: Simple script fools me? Dan Purgert <dan@djph.net> - 2016-09-29 14:18 +0000
Re: Simple script fools me? William Unruh <unruh@invalid.ca> - 2016-09-29 15:45 +0000
Re: Simple script fools me? Dan Purgert <dan@djph.net> - 2016-09-29 18:16 +0000
Re: Simple script fools me? Ivan Shmakov <ivan@siamics.net> - 2016-10-04 17:50 +0000
csiph-web