bash alias in scripts
bash在非交互式模式下是不扩展alias定义的,除非明确指定shell选项expand_aliases
因此要在脚本中使用alias定义,可以这样:
1 | shopt -s expand_aliases |
References:
[1]How to make alias command work in bash script or bashrc file
[2]Why doesn’t my Bash script recognize aliases?