rt,最近使用 bash call
bash -c "custom_functions"
的方式调用自定义 shell 函数时,发现总会报一个
custom_function:command not found
的错误;然后搜了下,有三种方式解决:
- 使用
declare -fx声明 - 使用
export -fx声明 - 使用
typeset -xf声明
bash -c "custom_functions"
custom_function:command not found
declare -fx 声明export -fx 声明typeset -xf 声明