> EB> 'chmod -x install-sh' is not portable. > > Thanks for the info. Do you actually know any system where this doesn't work?
Any system with coreutils-5.91 installed, and a umask that restricts x bits differently than the current x bit setting of the file: $ touch file $ chmod o+x file $ (umask 001; chmod -x file) chmod: file: new permissions are rw-r--r-x, not rw-r--r-- $ echo $? 1 The problem is that POSIX only specifies 'chmod -- -x file', with the weird rule that it is affected by the current umask, so since 'chmod -x file' is unspecified, coreutils was recently changed to warn the user that it didn't do what the naive user expects, while still following the POSIX formula for which bits are changed. > > EB> It is much more portable to do 'chmod a-x install-sh'. This bypasses the issue altogether by avoiding the problematic -x. -- Eric Blake