From owner-freebsd-hackers Sun Nov 2 06:43:25 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id GAA23370 for hackers-outgoing; Sun, 2 Nov 1997 06:43:25 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from heron.doc.ic.ac.uk (edDnTYuONr0uWzpbYSegPaAdwUESQPwG@heron.doc.ic.ac.uk [146.169.2.31]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id GAA23358 for ; Sun, 2 Nov 1997 06:43:01 -0800 (PST) (envelope-from njs3@doc.ic.ac.uk) Received: from oak66.doc.ic.ac.uk [146.169.33.66] ([Xxz/HvRkJOqEtfke2dGm6RPSz+MuRr+1]) by heron.doc.ic.ac.uk with smtp (Exim 1.62 #3) id 0xS1F7-0002EF-00; Sun, 2 Nov 1997 14:43:09 +0000 Received: from njs3 by oak66.doc.ic.ac.uk with local (Exim 1.62 #3) id 0xS1Eg-0000MG-00; Sun, 2 Nov 1997 14:42:42 +0000 From: njs3@doc.ic.ac.uk (Niall Smart) Date: Sun, 2 Nov 1997 14:42:42 +0000 In-Reply-To: Brian Somers "Re: Suggested addition to /etc/security" (Nov 2, 1:02am) X-Mailer: Mail User's Shell (7.2.5 10/14/92) To: Brian Somers , njs3@doc.ic.ac.uk (Niall Smart) Subject: Re: Suggested addition to /etc/security Cc: Brandon Gillespie , freebsd-hackers@freebsd.org Message-Id: Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Nov 2, 1:02am, Brian Somers wrote: } Subject: Re: Suggested addition to /etc/security > > On Nov 1, 10:58am, Brandon Gillespie wrote: > > > > > find / -nouser -nogroup > > > > Shouldn't this be "find / -nouser -o -nogroup -print"? > > > Yeah, or even better: > > > > > > files=`find / -nouser -o -nogroup -print` > > > ls -ldF $files > > > > > > (this looks better than find / -nouser -o -nogroup -exec ls -ldF {} \;) > > > > Looks better? They should produce identical output. "find / -nouser -o > > -nogroup -print | xargs -n 30" is more efficient btw :)) however > > using -exec with find is othe only one that works with filenames with > > embedded spaces. > > Check the -print0 option on find. That, and the -0 option to xargs > makes it a far better choice than -exec. Ah, I was aware of this but thought it was a GNUism. > BTW, why the -n 30 to xargs ? Well I thought that size of the arguments to ls might exceed ARG_MAX but a quick read of the xargs man page shows that it deals with this possibility (the default -s option is ARG_MAX - 2048) so I guess it's not necessary after all, even if it was necessary that probably wasn't the best way to deal with it so forget I ever mentioned it ;) Niall