我想用一个装饰器将方法名称从CamelCase更改为snake_case,我试过这个但是它不起作用:
#!/bin/bash
set -e
function cleanup() {
exitStatus=$?
if [ $exitStatus -ne 0 ]; then
rm -rf /tmp/alpha*
fi
exit $exitStatus
}
trap cleanup ERR
VAR1="test"
. /home/common/scripts/utils.sh
echo "Executing function1"
function1 $VAR1
echo "Executing function2"
function2 $VAR1
exit $?
有人知道怎么做吗?任何帮助将不胜感激..