public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Cygwin 'find' does not support the '-L' predicate?
@ 2009-09-05  3:50 Lee Rothstein
  2009-09-05  4:07 ` find not consistent with man/info pages? Was: " Lee D. Rothstein
  2009-09-05  4:08 ` Eric Blake
  0 siblings, 2 replies; 6+ messages in thread
From: Lee Rothstein @ 2009-09-05  3:50 UTC (permalink / raw)
  To: Cygwin eMail List

Apparently there are these thingies (special type of options)
called predicates in 'find' that are specified before a path that
tell it to follow or not follow links, etc.

I think I need the '-L' predicate that says follow them thar
links. However, the following command line works until I add the
'-L' predicate.

The following works:

  find "$PWD" -maxdepth 1 -type f -executable

but does not find executable files that are links

The following, which I assume (according to man and info) will
find executables that are links, does not work at all:

  find -L "$PWD" -maxdepth 1 -type f -executable

Or, is this pilot error?

Lee

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* find not consistent with man/info pages? Was: Re: Cygwin 'find' does  not support the '-L' predicate?
  2009-09-05  3:50 Cygwin 'find' does not support the '-L' predicate? Lee Rothstein
@ 2009-09-05  4:07 ` Lee D. Rothstein
  2009-09-05  4:08 ` Eric Blake
  1 sibling, 0 replies; 6+ messages in thread
From: Lee D. Rothstein @ 2009-09-05  4:07 UTC (permalink / raw)
  To: cygwin

I got the terminology all mixed up, but the bottom line is:

    # '-follow' is supposed to be deprecated, but the replacement
    # '-L' specified in 'man' and 'info' pages does not appear to
    # exist in Cygwin 'find' version 4.5.4
    find "$PWD" -maxdepth 1 -type f -follow -executable | gawk '


Lee Rothstein wrote:
> Apparently there are these thingies (special type of options)
> called predicates in 'find' that are specified before a path that
> tell it to follow or not follow links, etc.
>
> I think I need the '-L' predicate that says follow them thar
> links. However, the following command line works until I add the
> '-L' predicate.
>
> The following works:
>
>  find "$PWD" -maxdepth 1 -type f -executable
>
> but does not find executable files that are links
>
> The following, which I assume (according to man and info) will
> find executables that are links, does not work at all:
>
>  find -L "$PWD" -maxdepth 1 -type f -executable
>
> Or, is this pilot error?
>
> Lee
>
> -- 
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>
>


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cygwin 'find' does not support the '-L' predicate?
  2009-09-05  3:50 Cygwin 'find' does not support the '-L' predicate? Lee Rothstein
  2009-09-05  4:07 ` find not consistent with man/info pages? Was: " Lee D. Rothstein
@ 2009-09-05  4:08 ` Eric Blake
  2009-09-05  4:23   ` Lee Rothstein
  1 sibling, 1 reply; 6+ messages in thread
From: Eric Blake @ 2009-09-05  4:08 UTC (permalink / raw)
  To: cygwin, lee

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Lee Rothstein on 9/4/2009 9:50 PM:
> The following, which I assume (according to man and info) will
> find executables that are links, does not work at all:
> 
>  find -L "$PWD" -maxdepth 1 -type f -executable
> 
> Or, is this pilot error?

Pilot error.  -L works just fine.  Also, it is shorter to use . than
"$PWD" (for that matter, GNU find has an implicit . if you don't specify a
directory).  I think you're asking the wrong question, though - if what
you really want is to find all symlinks whose targets are executables, try
this:

find -P -maxdepth 1 -type l -xtype f -executable

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqh5DAACgkQ84KuGfSFAYATaACgpJXCp62sjsqJcGDIWHJGJe0t
eMEAniL1bKVglLYepAXD701/Yk0hpqGJ
=tJOl
-----END PGP SIGNATURE-----

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cygwin 'find' does not support the '-L' predicate?
  2009-09-05  4:08 ` Eric Blake
@ 2009-09-05  4:23   ` Lee Rothstein
  2009-09-05  5:34     ` Christopher Faylor
  0 siblings, 1 reply; 6+ messages in thread
From: Lee Rothstein @ 2009-09-05  4:23 UTC (permalink / raw)
  To: cygwin

Eric Blake wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> According to Lee Rothstein on 9/4/2009 9:50 PM:
>> The following, which I assume (according to man and info) will
>> find executables that are links, does not work at all:
>>
>>  find -L "$PWD" -maxdepth 1 -type f -executable
>>
>> Or, is this pilot error?
>
> Pilot error.  -L works just fine. 
I got the terminiology all wrong but find on my system does not allow -L

Here what works:

    # '-follow' is supposed to be deprecated, but the replacement
    # '-L' specified in 'man' and 'info' pages does not appear to
    # exist in Cygwin 'find' version 4.5.4
    find "$PWD" -maxdepth 1 -type f -follow -executable | gawk '

If I replace '-follow' with '-L' it tells me :

find: unknown predicate `-L'

> Also, it is shorter to use . than
> "$PWD" (for that matter, GNU find has an implicit . if you don't specify a
> directory).
Nope. The line is from a larger script and I need rooted paths.

> I think you're asking the wrong question, though - if what
> you really want is to find all symlinks whose targets are executables, try
> this:
No, I want to find all files whether normal or links that are executable.

Thanks for your help, and sorry about my prior confusion.

The larger script, 'rwhich', finds all commands that match an extended
regular expression.

E.g.:

  $ rwhich '^e_[bm]?s$'
  /local/Scripts/e_bs
  /local/Scripts/e_ms
  /local/Scripts/e_s

It works, now, and I've needed this for a long time. Glad it finally works.


Now, if I can only figure out how not to be bitten by Comcast's
motherlovin' bandwidth throttleing while I'm updating Cygwin. Sigh!

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cygwin 'find' does not support the '-L' predicate?
  2009-09-05  4:23   ` Lee Rothstein
@ 2009-09-05  5:34     ` Christopher Faylor
  2009-09-05  6:20       ` Lee Rothstein
  0 siblings, 1 reply; 6+ messages in thread
From: Christopher Faylor @ 2009-09-05  5:34 UTC (permalink / raw)
  To: cygwin

On Sat, Sep 05, 2009 at 12:23:10AM -0400, Lee Rothstein wrote:
>Eric Blake wrote:
>> According to Lee Rothstein on 9/4/2009 9:50 PM:
>>> The following, which I assume (according to man and info) will
>>> find executables that are links, does not work at all:
>>>
>>>  find -L "$PWD" -maxdepth 1 -type f -executable
>>>
>>> Or, is this pilot error?
>>
>> Pilot error.  -L works just fine. 
>I got the terminiology all wrong but find on my system does not allow -L
>
>Here what works:
>
>    # '-follow' is supposed to be deprecated, but the replacement
>    # '-L' specified in 'man' and 'info' pages does not appear to
>    # exist in Cygwin 'find' version 4.5.4
>    find "$PWD" -maxdepth 1 -type f -follow -executable | gawk '
>
>If I replace '-follow' with '-L' it tells me :
>
>find: unknown predicate `-L'

That's because, as the man page says, the -L has to come first.  You
can't replace the -follow with -L.  It has to be:

find -L "$PWD" -maxdepth 1 ...

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cygwin 'find' does not support the '-L' predicate?
  2009-09-05  5:34     ` Christopher Faylor
@ 2009-09-05  6:20       ` Lee Rothstein
  0 siblings, 0 replies; 6+ messages in thread
From: Lee Rothstein @ 2009-09-05  6:20 UTC (permalink / raw)
  To: cygwin

Christopher Faylor wrote:
> On Sat, Sep 05, 2009 at 12:23:10AM -0400, Lee Rothstein wrote:
>   
>> Eric Blake wrote:
>>     
>>> According to Lee Rothstein on 9/4/2009 9:50 PM:
>>>       
>>>> The following, which I assume (according to man and info) will
>>>> find executables that are links, does not work at all:
>>>>
>>>>  find -L "$PWD" -maxdepth 1 -type f -executable
>>>>
>>>> Or, is this pilot error?
>>>>         
>>> Pilot error.  -L works just fine. 
>>>       
>> I got the terminiology all wrong but find on my system does not allow -L
>>
>> Here what works:
>>
>>    # '-follow' is supposed to be deprecated, but the replacement
>>    # '-L' specified in 'man' and 'info' pages does not appear to
>>    # exist in Cygwin 'find' version 4.5.4
>>    find "$PWD" -maxdepth 1 -type f -follow -executable | gawk '
>>
>> If I replace '-follow' with '-L' it tells me :
>>
>> find: unknown predicate `-L'
>>     
>
> That's because, as the man page says, the -L has to come first.  You
> can't replace the -follow with -L.  It has to be:
>
> find -L "$PWD" -maxdepth 1 ...
>   
That doesn't work either.

'-L' for 4.5.4 does not work anywhere on the command line. '-L' is not 
required (in my application)
if '-follow' works, and it does. However, the man/info page says that 
'-L' should work, and '-follow'
is deprecated.
> cgf
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>
>
>   


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-09-05  6:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-05  3:50 Cygwin 'find' does not support the '-L' predicate? Lee Rothstein
2009-09-05  4:07 ` find not consistent with man/info pages? Was: " Lee D. Rothstein
2009-09-05  4:08 ` Eric Blake
2009-09-05  4:23   ` Lee Rothstein
2009-09-05  5:34     ` Christopher Faylor
2009-09-05  6:20       ` Lee Rothstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).