On 23 Mar 2007 17:01:40 -0400, Kevin D. Clark <[EMAIL PROTECTED]> wrote:
Here is how I would do this:

find your-dirname1 your-dirname2 -name \*out\* \
   -exec perl -e 'undef $/;
                  $filename=$ARGV[0];
                  $_=<>;
                  exit(!(-T $filename && /\bzip\b/))' \{\} \; -print \
     >zip.txt

 Holy crap!  Where's Perl's oft-decried extreme conciseness?  ;-)

 I much prefer the all-in-one approach:

grep -lwir --include=\*out\* . > zip.txt

 Yah, the find command is very useful, since it's generic, and thus
works in very complicated situations, when nothing else will.  But for
more common cases, the convenience features of modern *nix tools
really do save a lot of work.  :-)

--
"One day I feel I'm ahead of the wheel / And the next it's rolling over me"
                                                 -- Rush, "Far Cry"
_______________________________________________
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/

Reply via email to