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
Stolen from enzotib on ask ubuntu: Alias are deprecated in favor of shell functions. From bash
manual page:
For almost every purpose, aliases are superseded by shell functions.
To create a function, and export it to subshells, put the following in your ~/.bashrc
:
petsc() {
~/petsc-3.2-p6/petsc-arch/bin/mpiexec "$@"
}
export -f petsc
Then you can freely call your command from your scripts.