如何在 bash 脚本中使用 bash 配置文件中定义的函数?

sL'*_*sL' 5 bash profile export function

我的 bash_profile 中有一个投影功能。现在我试图从 bash 脚本调用这个函数,但是我得到一个未找到的错误。如何使投影功能对 bash 脚本可见?

小智 2

您必须导出该函数

export -f foo
Run Code Online (Sandbox Code Playgroud)

ref