On Wed, 10 Dec 2003 16:46:35 +0100, Eric Sunshine wrote:Unfortunately, older 'test' commands do not recognize the -x option,Just a try - this is also forbidden?: if ls -ld $f | grep -q '^...x'; then
The grep -q option is unportable. Autoconf works around this issue by redirecting output of grep to /dev/null rather than using -q or -s.
The '^' and '.' tokens in the grep expression also are not necessarily
portable since they are considered part of the "extended" regular
expression syntax which is provided by 'egrep' or 'grep -E'. Of course,
trying to hard-code 'egrep' or 'grep -E' is also unportable. Instead,
usage would have to be conditionalized based upon the result of AC_PROG_EGREP.
Finally, use of "ls -ld" may or may not be acceptable to the Autoconf community. Presently, there is only a single use of 'ls' in the entire Autoconf library of macros, and that is in the obscure and rarely used AC_FUNC_GETLOADAVG macro. At the very least, it would be a good idea to only use "ls -ld" after checking that such usage is valid (i.e. ensure that "ls -ld" actually works, and works as intended on the target platform).
-- ES