Error in calling a shell script from another script

HI,

We are using two shell scripts, script.sh,env.sh, where env.sh will be called inside script.sh. The variable inside env.sh is used as $var in script.sh.But while running the script its not identifying that variable. Is there any permission needed to call a script inside another script.

The script.sh will have something like

sh /path/env.sh
sh $var/runWF.sh

The script env.sh is having

export var=/rootpath

The error we got is

/runWF.sh not found

Please help

Thanks in advance
Priya

Try this...

. /path/env.sh
sh $var/runWF.sh

--ahamed

Calling script inside the script would invoke another shell which doesn't return the environment back to the parent shell after execution.

You should use the source.

source /path/env.sh

or 

. /path/env.sh

Its working.. Thanks... :slight_smile: