bug-findutils
[Top][All Lists]
Advanced

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

[sr #104971] Feature request: ?: expression


From: Eric Blake
Subject: [sr #104971] Feature request: ?: expression
Date: Tue, 20 Dec 2005 07:01:03 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5

URL:
  <http://savannah.gnu.org/support/?func=detailitem&item_id=104971>

                 Summary: Feature request: ?: expression
                 Project: findutils
            Submitted by: ericb
            Submitted on: Tue 12/20/05 at 07:01
                Category: None
                Priority: 5 - Normal
                Severity: 3 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
        Platform Version: None

    _______________________________________________________

Details:

Since find already has the GNU extension ',' operator (evaluate both
expressions, without short-circuiting based on the first), it might be useful
to have a GNU extension ? : operator (evaluate the first expression, which
determines which of the other two expressions will be evaluated), with
precedence below -o but above ','.

As an example usage pattern:

$ find . -type l \? \( -exec echo {} 'links to ' \; , -exec readlink {} \; \)
: -exec echo {} not a link \;

This capability is just syntax sugar; the above proposed command line can be
mimicked by the longer:

$ find . \( -type l \( -exec echo {} 'links to ' \; , -exec readlink {} \; ,
-true \) \) -o -exec echo {} not a link \;







    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/support/?func=detailitem&item_id=104971>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

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