Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.os.linux.debian > #8417

Re: Simple script fools me?

From William Unruh <unruh@invalid.ca>
Newsgroups alt.os.linux.debian
Subject Re: Simple script fools me?
Date 2016-09-29 14:04 +0000
Organization A noiseless patient Spider
Message-ID <nsj70m$4vp$1@dont-email.me> (permalink)
References <nsivjc$ckm$1@dont-email.me>

Show all headers | View raw


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$'
>
> I want to avoid the output-lines:-
> ...
> grep: ./JS/Documents/Scratch: No such file or directory
> grep: Projects/Circle30.sb: No such file or directory
> grep: ./JS/Documents/Scratch: No such file or directory
> grep: Projects/ZeroOne.sb: No such file or directory
>
> Not only what-to-use, but why mine-fails.

Those are grep errors put out on stderr (which by default is directed to
the console, as well as stdout).

>

Back to alt.os.linux.debian | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


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