Home » Questions » Computers [ Ask a new question ]

Why does an alias work in the Terminal, but not when called from a script?

Why does an alias work in the Terminal, but not when called from a script?

I've added the following to my ~/.bash_profile

Asked by: Guest | Views: 339
Total answers/comments: 1
Guest [Entry]

This is because bash only reads ~/.bash_profile for interactive shells. Move your alias definitions to ~/.bashrc and it should work. Take a look at the INVOCATION section of the bash manpage for more details on how this all works.