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
.bashrc is meant for one purpose: to configure the environment for your interactive shells. If you have code that you want shared between your .bashrc and other scripts, then it belongs in a separate file that is sourced by each of your .bashrc and shell script.