Hi,
I am attempting to bootstrap m4 on z/OS which uses gnulib-tool.
The process fails trying to do:
/bin/sh gnulib/gnulib-tool –update
The error is on line 1571, where the z/OS shell (an older POSIX ‘sh’) issues:
FSUM7728 bad ${} modifier
After reading the POSIX Shell Command Language
(https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_03),
in particular section 2.3 Token Recognition, I believe this is because
tokenization of the entire shell script happens before execution, and therefore
cachevar=c_${1//[!a-zA-Z0-9_]/_}
is getting a tokenization failure on the ${…} parameter expansion, even though
that path of code would not be executed.
So the approach of defining one or other syntax of function based on a
conditional does not work for our older shell.
I am happy to try out alternatives here that people may have. The simplest is
just to always use the ‘else’ path, but I don’t know if this is performance
critical and therefore unacceptable on platforms with a newer shell.
Thanks, Mike