I am writing a bash script that runs each of its arguments as a command. This works for commands in my PATH, but not for aliases. I can directly call an alias in the script, but I can't call an alias that has been passed as an argument.
The problem (I assume) is that aliases are expanded before variables.
I use a script (which I do not have write access to) that creates a bunch of aliases to set up an environment. I would like to create a bash function to setup my environment, but it seems that the aliases do not survive to the function body.
Here's a minimal example:
alias fooAlias='echo "this will never work!"'
I want to have a script to call with params which adds some aliases to my current shell. The aliases have to be builded in respect to the calling parameters and the current directory from where I start it.