For some reason, I had to add an alias to my bash. I have added the alias in /root/.bashrc which also contains the following piece of code:
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
The new alias works like a charm when it is used in the console. However, when I execute a script file myscript.sh with this alias in, I get a command not found error. It seems like I should tell .sh files to use the same environment as bash but I don't know how to do that.