I can't count the number of times I've typed: source en<tab>
only to be left with a bunch of garbled text on the screen because it sourced the program env instead of the local env.sh.
I tried making a simple function to detect this particular use case but it didn't work.
This is what I tried:
source () {
if [ "$1" == "env" ]
then
source ./env.sh
else
source $@
fi
}
I realize that source is a shell command which is probably why it didn't work but I don't really care about how its implemented, I just want to stop sourcing binaries on my $PATH before the local directory.
Cheers!