`${SHELL##*/}` depends on user configuration; `${0##*[-/]}` does not
LucasLarson opened this issue · 0 comments
LucasLarson commented
The scripts below appear shell-agnostic, but if running them using Bash on a system whose ${SHELL}
is Zsh, they don’t work at all.
For example, instead of:
. "${HOME}/.${SHELL##*/}rc" && exec "${SHELL##*/}" --login
we should use:
. "${HOME}/.${0##*[-/]}rc" && exec "${0##*[-/]}" --login
dotfiles/.oh-my-zsh/custom/aliases.zsh
Lines 227 to 231 in 124227f