Page 1 of 1

Calling a shell script from within another shell script.

Posted: 2017/04/14 06:50:24
by akothare77
Hi All !

I am a relative newbee to Linux in general.

I have 2 shell scripts.

Script 1:
Sets some python env variables
Triggers a python script
The output of the above python script is redirected to a log file based on parameter passed in from Script2.

Script2:
Set some different variables.
Triggers Script1 with a parameter1
Triggers Script2 with a parameter2
Triggers Script3 with a parameter3.

I know individually Script1 is working fine and creates 'n' different log files, based on parameters passed to it.

However, when I trigger Script2 - I don't find any log files getting generated.

Am trying to google this, but am not able make much of a headway into this issue.

Could totally be a mistake on my part, but I dont really know.

Any help is appreciated.

Thanks and regards,
Akshay

Re: Calling a shell script from within another shell script.

Posted: 2017/04/15 22:52:50
by drknut
you should post a MWE https://en.wikipedia.org/wiki/Minimal_Working_Example of what you are trying to achieve.

Re: Calling a shell script from within another shell script.

Posted: 2017/04/18 17:41:49
by aks
Suspect your calling shell is "overwriting" the existing shell. Suggest you Google around subshells (i.e: lunch it in a new process)....