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/



_______________________________________________
Bug-findutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-findutils

Reply via email to