Hi everyone,
I have this script which runs inside /etc/profile.d/which2.sh
It executes whenever the shell is loaded. On this particular computer the default shell is bash, but I'm using mksh for speed reasons. When opening the mksh shell I get an error: 'export: -f: unknown option'
Ideally I want to keep the functionality of this script, but make it mksh compatible while still working with bash.
Is this possible? Thanks
I have this script which runs inside /etc/profile.d/which2.sh
Code:
# Initialization script for bash and sh
which() {
(alias && declare -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-dot --show-tilde $@
}
export -f which
Ideally I want to keep the functionality of this script, but make it mksh compatible while still working with bash.
Is this possible? Thanks