home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] Odd behaviour in find

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On 15-11-25 04:00 PM, Alex Pilon wrote:
>> This is all documented in the manual.
> 
> I know; see other subthread. What's odd is that `find -xdev -- foo` doesn't work, yet `find -- foo` does. I
> expected -- to be properly interpreted as the end of options indicator, as per the manual.

In the case 'find -xdev --' the '--' is coming after the first expression because '-xdev' is a predicate.

In the case 'find -- foo' the '--' is coming before the first expression because 'foo' is a path.

This is entirely consistent with the manual.  The optional '--' just has to come before the first expression if
something that could be ambiguously interpreted as an option is an argument to an expression.

- -- 
Stephen M. Webb  <stephen [ dot ] webb [ at ] bregmasoft [ dot ] ca>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBCgAGBQJWViSBAAoJEAoP+EW32zQnYHgQANQbgFfND/11NIWGac8unTso
1o6ekIskbm90c2j9OQnNCihkfQeRTjHdRV76NjoHzFiUsMfG6SBmk6PVlAGaq7Lt
W7XGhqNVJfG+kkj/L40BxUKVMvgaEhifr0FQIQG0t+C3EPdJWh1hSVsOx1i9L3aC
I4tPJpXqkQXSqdIJZZBuzrcncW3HYeQiSBIub9LnCjz79o2eA7Q0gPj35g6/vT5q
8bCgsaaAKCvl5VWF19qdy/GZGBqJToXBZoMLu7dy/Wb6rN08v1ICiqkDt0q/yVE2
Iji+DXUYIwSp7AdvIcZ/rngaTAeNg9zsKr++sLkkZe8FV2GKGDyNxCZWmPluOQ/s
EYsAozb4GjsuR3xh/9qI8PGYJWwnylVZN6Xpy/4KkWeTU7b9UBtWfUMDTKE3OuaZ
V9ZbvdftkocL774+lnShf1Zh7Jx0TaCxqxyJozaFlaCv1QzS4Cb+nqkEFLwihHcc
w2+eJ7MH5j5lLoKYkX8Os1WKi90r3E8+k60ftzWm8nzZA9XdOEQva4mMfdmjsz4n
rBLpD+ZGzXjOnELp6YzjVR7SPf1UUq9WznJiRa6csMGiqs1SSfzFz6SyzZJgRi0J
lPqDSKaWUcxAY4puNlOfqU9hKmNyRcEZ7uQM0i8NT9+VZU9t2vcTJM2rOqf8Cah7
gyhzBuHnfFnSMxiWCW1j
=7IGq
-----END PGP SIGNATURE-----