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/folder
source $SOME_VAR/loading/stuff.sh --quiet
loadApp1
loadApp2
loadApp3
loadApp4
I 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.
stuff.sh? Are you using.to run in in your current shell, or something like./stuff.shto run it in a different shell? If it runs in a separate shell, any aliases or environment variables it sets up will have no effect on your current shell. See stackoverflow.com/questions/2197461/…function func_name() {and}around, I tough this would be redundant