in reply to Re: grep or perl
in thread grep or perl

Many thanks for your suggestion and time. The grep --help command shows the following:
-v, --invert-match select non-matching lines
I wish to copy files that do not contain NNNNNs. I am not doing it on a line by line basis. Also I don't understand what the program xargs does also xargs --help does not tell me much.

Replies are listed 'Best First'.
Re: Re: Re: grep or perl
by broquaint (Abbot) on Jun 04, 2003 at 13:41 UTC
    I wish to copy files that do not contain NNNNNs.
    Ah yes, sorry you'll want the -L switch as nite_man mentioned. That will output all the files that did not match the criteria.
    Also I don't understand what the program xargs does
    It's roughly equivalent to
    perl -e 'exec "@ARGV " . join " ", <>'
    So execute the given program and provided parameters and then add anything read from the pipe as arguments.
    HTH

    _________
    broquaint

      It's roughly equivalent to

      perl -e 'exec "@ARGV " . join " ", <>'

      So execute the given program and provided parameters and then add anything read from the pipe as arguments.

      This is true, but it might also be useful to note that xargs breaks the command line up into chunks small enough to fit on one command. For example, if you tried passing 40,000 filenames as one big long command line, it wouldn't work. Instead you could echo the 40,000 filenames into xargs (or, more realistically, pipe the output from find or grep), which will break them up accordingly.

      As a fun test, try the following: echo `find /usr -type f` vs find /usr -type f | xargs echo