From owner-freebsd-hackers Sat Jul 11 00:18:25 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id AAA06843 for freebsd-hackers-outgoing; Sat, 11 Jul 1998 00:18:25 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from mail.camalott.com (root@[208.203.140.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id AAA06838 for ; Sat, 11 Jul 1998 00:18:22 -0700 (PDT) (envelope-from joelh@gnu.org) Received: from detlev.UUCP (tex-94.camalott.com [208.229.74.94]) by mail.camalott.com (8.8.7/8.8.5) with ESMTP id CAA11682; Sat, 11 Jul 1998 02:18:19 -0500 Received: (from joelh@localhost) by detlev.UUCP (8.8.8/8.8.8) id CAA10297; Sat, 11 Jul 1998 02:17:33 -0500 (CDT) (envelope-from joelh) Date: Sat, 11 Jul 1998 02:17:33 -0500 (CDT) Message-Id: <199807110717.CAA10297@detlev.UUCP> To: circuit@vinson.navy.mil CC: dchapes@ddm.on.ca, rminnich@Sarnoff.COM, hackers@FreeBSD.ORG In-reply-to: (circuit@vinson.navy.mil) Subject: Re: makeinf an executable command in Unix From: Joel Ray Holveck Reply-to: joelh@gnu.org References: Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > I am trying to make a cleanup routine for my hp-ux system. I made a file > with the simple command > find / -name core -print > I saved it as .cleanup > everytime i execut it with > . .cleanup > command it gives me Permission denied on several directories. Can anyon > ehelp me out here? This belongs in -questions, not in -hackers. Execute it as root if you want it to be able to search every directory. Execute it as a mortal if you only want it to be able to search directories only mortals can read. (The main difference is directories that may have sensitive information, like /var/crash.) Better yet, add it to /etc/daily.local and let it run automatically and mail root the results. (root generally should be forwarded to the sysadmin in /etc/aliases anyway; don't forget to run newaliases!) Don't use find ... -exec rm -f {} ; as this is a security hole. The command may need to be find / -name "*.core" -print instead, since FreeBSD currently stores corefiles under progname.core rather than just core. (I don't know what all versions this applies to.) Happy hacking, joelh -- Joel Ray Holveck - joelh@gnu.org - http://www.wp.com/piquan Fourth law of programming: Anything that can go wrong wi sendmail: segmentation violation - core dumped To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message