Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Use an 'rmdir' function that's smart about .DS_Store files' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use an 'rmdir' function that's smart about .DS_Store files
Authored by: eengstrom on Nov 17, '13 08:29:20PM
Why are you all making it so hard. How about this:
rmdir() { for d in "${@}"; do [ 0 -eq $(ls "$d" | grep -v DS_Store | wc -l) ] && env rm -f "$d"/.DS_Store; done; env rmdir "${@}"; }

[ Reply to This | # ]