summary:curious question about find

From: Carl Ma <carl_ma_at_scotiacapital.com>
Date: Sat Nov 03 2001 - 15:20:57 EST
Hello everyone,

Most people suggest I should escape bang(!) to make it working.

However I find the same command works well to exclude files as:
$find .  ! \( -name <filename> -a -type f \) -print

so I can use the following to exclude directory:
$find . -type d ! -name <dir_name> -print


Give my thanks to:

efritz@glja.com
sanjiv@aryabhat.cs.umsl.edu
Mark.Neill@mortgagefamily.com
LParkins@niaid.nih.gov
hmaiwald@hns.com
eric.horne@std.teradyne.com

Best regards,

carl
-- 

> 
> Hello Everyone,
> 
> When I want to exclude some directories from the cpio file, I
use
> the following expression:
> $find . -depth ! \( -name [directory_name] -a -type d \)
-print | cpio
> -oBcv > /var/tmp/1.cpio
> 
> It works on Solaris 8 and BSD system. However it doesn't work
under
> Solaris 7, no error messages,
> just doesn't work as it should. Even I have another working
option like:
> $find . -name <directory_name> -prune -o -print
> 
> I wonder why the "!" doesn't work under solaris 7. Is it
attributed to
> the shell I am using?
> (on solaris 8, I use bash and use csh on solaris 7)
> 
> Welcome your suggestions & have a good weekend,
> 
> carl



             \\\___/// 
            \\  - -  //
             (  @ @  )
 +---------oOOo-(_)-oOOo-------------+
 |          /_/_/    /_/_/_/_/_/     | 
 |         _/_/        _/_/          |
 |        _/_/        _/_/           |
 |       _/_/        _/_/            |
 |      /_/_/       /_/_/            |
 |    Carl E. Ma - (416)863-7731     |
 |     carl_ma@scotiacapital.com     | 
 +------------------Oooo-------------+
            oooO   (   )
           (   )    ) /
            \ (    (_/
             \_)
Received on Sat Nov 3 20:20:57 2001

This archive was generated by hypermail 2.1.8 : Wed Mar 23 2016 - 16:32:34 EDT