- Code: Select all
ls -lO "$1" | grep -q "uchg" && exit 1 || exit 0
Possibly there's a built-in way of doing this; but this what I've come up with. I wrote up the explanation of how this works: https://www.ojisanseiuchi.com/2023/06/11/telling-hazel-not-to-match-locked-files/