The local keyword is not 100% portable if /bin/sh is indeed the Bourne Shell, or if it is an alias to ksh93 (such as on Solaris / illumos), which uses typeset instead. (Reference) In that case using any of the functions will report a local: not found (No such file or directory) error.
The
local
keyword is not 100% portable if/bin/sh
is indeed the Bourne Shell, or if it is an alias to ksh93 (such as on Solaris / illumos), which usestypeset
instead. (Reference) In that case using any of the functions will report alocal: not found (No such file or directory)
error.