Gentoo Archives: gentoo-dev

From: Juergen Hoetzel <gentoo@×××××××.info>
To: gentoo-dev@××××××××××××.org
Subject: Re: [gentoo-dev] More on proper 'find' usage
Date: Fri, 18 Mar 2005 13:17:08
Message-Id: 20050318130610.GA2296@h5331.serverkompetenz.net
In Reply to: [gentoo-dev] More on proper 'find' usage by Ciaran McCreesh
1 And the first victim is:
2 /bin/rc-status:
3 runlevels[${arridx}]=`find ${runleveldir}/${level} -type l -printf '%f '-maxdepth 1`
4
5 But GNU is merciful and just warns about it:
6
7 /tmp/findutils-4.2.20/find/find: warning: you have specified the -maxdepth option after a non-option argument -type, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it). Please specify options before other arguments.
8
9 Runlevel: default
10 local [ started ]
11 netmount [ started ]
12 net.eth0 [ started ]
13 sshd [ started ]
14 slapd [ started ]
15 apache2 [ started ]
16 vixie-cron [ started ]
17 xinetd [ started ]
18 saslauthd [ started ]
19 syslog-ng [ started ]
20 stunnel [ started ]
21 sendmail [ started ]
22 vsftpd [ started ]
23 zope-2.7.4 [ started ]
24
25
26 Jürgen
27
28 > Just to warn you... New findutils releases are starting to get a lot
29 > more picky about being given correct arguments. The correct way to
30 > invoke find to avoid problems is as follows:
31 >
32 > find [paths] [options] [rules] [actions]
33 >
34 > The [paths] part is mandatory, and the [options] (such as -maxdepth)
35 > should come *before* any [rules].
36 >
37 > --
38 > Ciaran McCreesh : Gentoo Developer (Vim, Fluxbox, shell tools)
39 > Mail : ciaranm at gentoo.org
40 > Web : http://dev.gentoo.org/~ciaranm
41 >
42
43
44
45 --
46 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] More on proper 'find' usage Mike Frysinger <vapier@g.o>