How does conda's source activate foo work

Solution 1:

Found details for the builtin source in ss64's man pages.

Unless you provide an exact path to filename then bash will look first via the PATH variable and then in the current directory (only if filename is not found in $PATH.) If any arguments are supplied, they become the positional parameters when filename is executed. Otherwise the positional parameters are unchanged.

So,

source activate <env-name>

is calling /Users/dilum/anaconda/bin/activate and passing the desired environment name as an argument.