I have one shell script which is using a config file. I added the following code to use config file.
source abc.config
When I ran this shell script manually it is working fine. However, when I make this shell script as a background process using no hup
, it gives me following error.
line 19: source: abc.config: file not found
I debugged the shell script using
bash -x shell_script.sh
In debugging it is taking config values properly and shell script worked.
This shell script was running fine a few days ago, but suddenly it started to give errors like this. Also the same script is running fine on another environment.
To run this shell script properly we have to give the full path of config file in source statement. But that is not correct way, since config file and shell scripts both are in same folder and for source syntax we have to give config file name only.
How can I fix this issue?
P.S : Currently, I have added path of config file as follows
source ${path}/abc.config
But I want to source a config file without path of it.