Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Cyborg)
  • No Skin
Collapse
Brand Logo

CIRCLE WITH A DOT

  1. Home
  2. Uncategorized
  3. Warum gibt mir `find .

Warum gibt mir `find .

Scheduled Pinned Locked Moved Uncategorized
3 Posts 3 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • qsx@chaos.socialQ This user is from outside of this forum
    qsx@chaos.socialQ This user is from outside of this forum
    qsx@chaos.social
    wrote last edited by
    #1

    Warum gibt mir `find . -path ./.git -prune -o \( -type f -a -executable \)` auch `./.git` als Ergebnis? So wie ich die Manpage verstehe sollte es das eben nicht, und auf `-type f` matcht es ja auch nicht.

    penma@chaos.socialP 23n27@dgc.social2 2 Replies Last reply
    1
    0
    • qsx@chaos.socialQ qsx@chaos.social

      Warum gibt mir `find . -path ./.git -prune -o \( -type f -a -executable \)` auch `./.git` als Ergebnis? So wie ich die Manpage verstehe sollte es das eben nicht, und auf `-type f` matcht es ja auch nicht.

      penma@chaos.socialP This user is from outside of this forum
      penma@chaos.socialP This user is from outside of this forum
      penma@chaos.social
      wrote last edited by
      #2

      @qsx "-prune True; if the file is a directory, do not descend into it." Also es ist selbst true (d.h.: matcht), aber steigt nicht ab.

      Im Grunde bräuchtest du: find . \! \( -path ./.git -prune \) -a \( sonstige Tests \)

      Erster Teil: prunet und matcht auf alles außer .git selbst
      Zweiter Teil nach -a (nicht -o): eigentliche Tests

      (Keine Ahnung warum das so nicht im Beispiel in der Manpage steht)

      1 Reply Last reply
      0
      • qsx@chaos.socialQ qsx@chaos.social

        Warum gibt mir `find . -path ./.git -prune -o \( -type f -a -executable \)` auch `./.git` als Ergebnis? So wie ich die Manpage verstehe sollte es das eben nicht, und auf `-type f` matcht es ja auch nicht.

        23n27@dgc.social2 This user is from outside of this forum
        23n27@dgc.social2 This user is from outside of this forum
        23n27@dgc.social
        wrote last edited by
        #3

        @qsx Ich verstehe das so dass der Trick bei dem Beispiel

        find . -path ./src/emacs -prune -o -print

        ist, dass -o short-circuited und das explizite -print das implizite -print über die gesamte Expression deaktiviert. Das führt dazu dass -print nur passiert wenn -prune false ist.

        Analog in deinem Fall scheint

        find . -path ./.git -prune -o \( -type f -a -executable -a -print \)

        das Richtige zu tun.

        1 Reply Last reply
        0
        • R relay@relay.infosec.exchange shared this topic
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups