5 ms·
In a script, there will almost never be any aliases defined, because noninteractive shells don’t load ~/.bashrc. $ sh -c "which ls; command -v ls" /bin
by anderskaseorg 5y ago
In a script, there will almost never be any aliases defined, because noninteractive shells don’t load ~/.bashrc.
$ sh -c "which ls; command -v ls"
/bin/ls
/bin/ls
If the script is #!bash rather than #!sh, it’s not even possible to define an alias.
$ bash -c "alias ls='ls --color=auto'; which ls; command -v ls"
/bin/ls
/bin/ls
- pxc 5y agoYou can still define functions in scripts, and those might wrap commands or accidentally share their names.