且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在其他脚本中使用 .bashrc 中定义的别名?

更新时间:2023-12-05 18:55:10

除了source ~/.bashrc之外,还需要在脚本中做shopt -s expand_aliases.

You need to do shopt -s expand_aliases in the script in addition to sourcing ~/.bashrc.