From owner-freebsd-questions Thu Aug 26 15: 5:21 1999 Delivered-To: freebsd-questions@freebsd.org Received: from eeyore.cc.uic.edu (EEYORE.CC.UIC.EDU [128.248.171.51]) by hub.freebsd.org (Postfix) with ESMTP id 49C0A1514F for ; Thu, 26 Aug 1999 15:05:08 -0700 (PDT) (envelope-from lucas@comp04.prc.uic.edu) Received: from comp04.prc.uic.edu (COMP04.PRC.UIC.EDU [128.248.230.104]) by eeyore.cc.uic.edu (8.9.3/8.9.3) with SMTP id RAA26635 for ; Thu, 26 Aug 1999 17:03:05 -0500 (CDT) Received: (qmail 94792 invoked by uid 1000); 26 Aug 1999 22:05:28 -0000 Date: Thu, 26 Aug 1999 17:05:28 -0500 From: Lucas Bergman To: Gary Kline Cc: freebsd-questions@freebsd.org Subject: Re: find -f Message-ID: <19990826170528.A93854@comp04.prc.uic.edu> Reply-To: iceberg@pobox.com References: <199908262137.OAA20581@athena.tera.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.7i In-Reply-To: <199908262137.OAA20581@athena.tera.com> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Is there a way of using find to locate all regular files that > are not binaries and also not executable scripts? The following script (I think) echoes the name of all files off the current directory that are text and have no executable bits set. I didn't test it that rigorously, so YMMV. ------------ snip snip snip ------------ #!/bin/sh list=`find . \( -type f -and \! -perm -001 \ -and \! -perm -010 -and \! -perm -100 \) -print` for file in $list do if { file $file | grep -i text 2>&1 >/dev/null; } then echo $file fi done ------------ snip snip snip ------------ Don't count on running this too often, though, cuz it is Slower Than Windows (TM). HTH, Lucas -- S. Lucas Bergman University of Illinois at Chicago Mathematics Department PGP Public Key (0xC0C73619): finger -l lucas@math.uic.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message