小编suf*_*ery的帖子

如何在 bash shell 脚本中调用函数

我只是想知道在 bash shell 脚本之间$(one_function)one_function中调用函数的区别。

当我在 中设置变量PS1~/.bashrc,我无法通过one_func ex调用该函数:

export PS1="\n\[\e[31m\] \$(one_func)  # it works 

export PS1="\n\[\e[31m\] one_func      # it doesn't work
Run Code Online (Sandbox Code Playgroud)

linux bash shell

4
推荐指数
1
解决办法
3611
查看次数

标签 统计

bash ×1

linux ×1

shell ×1