How to use aliases defined in .bashrc in other scripts?

后端 未结 6 1080
情话喂你
情话喂你 2020-11-27 06:36

In ~/.bashrc, I defined some aliases. But I cannot use them in other shell scripts, where I can only use aliases defined right there. Even though I sourced bashrc, it still

6条回答
  •  日久生厌
    2020-11-27 07:30

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

提交回复
热议问题