Hi ,
I have two scripts parent.sh and child.sh. There is a variable in parent.sh which needs to be accessed by the child process. I have achieved this by exporting the variable in the parent script and the variable is available to the child process?
Is there any way that child can modify the value of the export variable defined in parent shell?
Parent.sh
#!/bin/bash
export g_var=2
./child.sh
child.sh
#!/bin/bash
g_var=`expr $g_var + 1 ` #This modification is available in child shell only.