Instead of writing this execpermfix thing in C, I'd do it
as a one-liner in shell.

  find FILES-AND-DIRECTORIES \
    -type f \
    -execdir sh -c 'file --brief "$1" | grep -q executable' -- '{}' \; \
    -print0 \
  | xargs -0 chmod --verbose +x

Works for me!

(The contortions in the middle are to make sure filenames containing
whitespace, literal single or double quotes, etc, are handled
correctly.)

                                        Cheers,

                                        --Barak.
--
Barak A. Pearlmutter
 Hamilton Institute & Dept Comp Sci, NUI Maynooth, Co. Kildare, Ireland
 http://www.bcl.hamilton.ie/~barak/


-- 
To UNSUBSCRIBE, email to debian-wnpp-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/87ppj8dtz3....@cs.nuim.ie

Reply via email to