我只是想知道在 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)