Note the command necessary to prevent the function from recursing -- calling itself when running activate. For the general case, an alias is the wrong tool for this job. It'll work in this specific case, because it's only the last command to which arguments are being passed and there's...
export LESSOPEN="| grep -P 'alias|$' --color=always %s" export LESS='-R' ... To automatically set an environment variable, we can add it with export in our ~/.bashrc. Let’s break down the input preprocessor variable, LESSOPEN: |: pipes the output of the command to less ...