I am writing a bash script for the installation of an environment manager but it means that I have to install something within multiple directories. See my other question for more details. But this led me to rethink my approach.
I was now thinking of making it 3 separate bash scripts. Then the one will just call the other. Here is the thing: I need to some how source .bash_profile
within the parent shell. The question is, would a bash script that has been called within a bash script be running in a new shell or the parent shell or would it be in a new shell within the host bash script shell within the parent shell?
'shell-ception' I know its cooking my brain. i would really like to automate this process and this is the wall I am facing.
(cmd)
(wherecmd
is not builtin) doesn't fork an additional process. More generally in(cmd1; ...; cmdn)
,cmdn
is executed by the subshell process (exception to that (for most shells) is when atrap
is set in the subshell). – Stéphane Chazelas May 30 '13 at 12:12