I have a shell script (let's call it parent.sh) which calls another shell script (child.sh), passing it an argument.
The child script does some work and sets a value in a variable called create_sql
. I want to access this create_sql
variable from the parent script which invoked it.
I am calling the child script from within the parent script like this:
./child.sh "$dictionary"
and straight afterwards I have the line:
echo "The resulting create script is: "$create_sql
However, there is no value being output, however, in the child script I am doing the same thing and the variable is definitely set.
How can I get this to work so that I can read variables created by the child script?