Bash allows you to use functions with names that are not valid identifiers that must be created when they are not in posix mode.
So:
set -o posix function suman-inspect { echo "using suman-inspect function"; }
gives:
bash: `suman-inspect': not a valid identifier
ruakh makes a valid point by quoting man bash
. The source code ( builtins/set.def
) has a comment: Posix.2 first indicates the try parameters, then the functions, but ...
the POSIX standard says that if neither -f or -v is specified, the name refers to a variable; if a variable with this name does not exist, it is not known whether a function with this name, if any, should not be set.
So the actual behavior is that the old backup is "unspecified." Anyway, the error is contained in the bash documentation. But to be honest, in another place man bash
says:
Function definitions can be removed using the -f option for undefined inline.
source share