I have some scripts (that are out of my control) that loads some environment settings to my session. So whenever I want to load I have to execute a series of commands:export SOME_VAR=/path/to/main/foldersource $SOME_VAR/loading/stuff.sh --quietloadApp1loadApp2loadApp3loadApp4I want to do this with a single command, so I created a function (pretty much the lines above), but it doesn't work.I think it's because the loadApps are aliases, loaded in the stuff.sh so at time Bash parses my functions it doesn't know the aliases yet.How could I do this with a single command without losing portability?PS: I do not want to copy the alias to my $HOME/.bashrc because they can be changed elsewhere and I won't see it.
How to create a function based on commands not defined yet?
bash;alias
If they are aliases, you'll have to write it:myFunction() {  export SOME_VAR=/path/to/main/folder  . $SOME_VAR/loading/stuff.sh --quiet  eval '  loadApp1  loadApp2  loadApp3  loadApp4'}aliases are expanded at the time they are read/parsed. eval forces such a parsing.