且构网

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

bash脚本没有读取bashrc中的别名

更新时间:2023-12-05 18:59:58

别名不会在非交互式 shell 中展开.

Alias are not expanded in non-interactive shells.

创建别名的唯一方法是使用包含别名的脚本来获取目标脚本.

The only way to make an alias is to source the target script with the one which contains the alias.

$ source .bashrc
$ . custom_script.sh