Use Alias in Bash Script

A few weeks ago, I had trouble accessing aliases in bash scripts. It turns out that aliases are not expanded in scripts, only when the shell i interactive. However, we can get around this by using shopt to expand_aliases at the top o our script.

shopt -s expand_aliases

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.