[Slackbuilds-users] template find/chmod RFC
B. Watson
urchlay at slackware.uk
Mon Aug 3 21:45:02 UTC 2026
On Mon, 3 Aug 2026, Yiannis wrote:
> One outer group fixes it:
>
> find . ! -type l -a \( \
> \( -perm /111 -a ! -perm 755 -a -exec chmod -f 755 {} + \) -o \
> \( ! -perm /111 -a ! -perm 644 -a -exec chmod -f 644 {} + \) \
> \)
>
> Same behaviour, same timing, two extra characters - but now the code stays more correct if either branch
> is ever edited.
Nice catch! You're absolutely right, and I'm going to replace my
original code with your version (well, test it first, of course, but
it looks obviously correct to me).
More information about the SlackBuilds-users
mailing list