bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error in find


From: James Youngman
Subject: Re: Error in find
Date: Sun, 18 Sep 2011 01:20:50 +0100

On Fri, Sep 16, 2011 at 3:22 AM, Aayush Upadhyay
<address@hidden> wrote:
> Hey guys,
>
> A student in my CS class found an error in find.

It's OK for anybody to post to this mailing list, including students.

More specifically with regard to reporting bugs in programs, please
try to include at least this information:

1. What you did
2. What you expected to happen
3. What precisely did happen
4. Any relevant context information (for example software versions)

> "According to the man page,
>
>  expr1 -a expr2
>         Same as expr1 expr2.
>
> yet
>
>  % find -depth -a -depth
>
> gives an error message but
>
>  % find -depth -depth
>
> does not."
>
> Does the man page need to be updated, or is it as desired?

It's the intended behaviour, though arguably a confusing corner case.
 So that the context is clear for the list members who haven't seen
the message, here it is:

$ find -depth -a -depth >/dev/null
find: warning: you have specified the -depth option after a non-option
argument -a, but options are not positional (-depth affects tests
specified before it as well as those specified after it).  Please
specify options before other arguments.

$ find -depth  -depth >/dev/null

In the first of these two cases, the -a operator isn't an option and
the second appearance of -depth therefore triggers the warning
message.    In the second case, no non-option arguments at all are
parsed, and so the warning isn't issued.

I do agree that in this particular case this could be confusing, so if
your student would like to propose an update to the manual page, or a
specific change in the implementation, this mailing list would be the
place to do it.

Thanks,
James.




--
This email is intended solely for the use of its addressee, sender,
and any readers of a mailing list archive in which it happens to
appear.   If you have received this email in error, please say or type
three times, "I believe in the utility of email disclaimers," and then
reply to the author correcting any spellings (and, optionally, any
incorrect spellings), accompanying these with humorous jests about the
author's parentage.   If you are not the addressee, you are
nevertheless permitted to both copy and forward this email since
without such permissions email systems are unable to transmit email to
anybody, intended recipient or not.  To those still reading by this
point, the author would like to apologise for being unable to maintain
a consistent level of humour throughout this disclaimer.  Contents may
settle during transit.  Do not feed the animals.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]