Is there a way I can use .bash_aliases in a shell-scripts?

Is there a way I can use bash aliases from my .bash_aliases file within a shell-scripts?

I thought of something like including
source "$HOME/.bash_aliases into my script

but it does not work.

Asked By: nath

||

Non-interactive shells don’t expand aliases by default. You need to enable it:

shopt -s expand_aliases
Answered By: choroba
Categories: Answers Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.