I have a simple script that uses CAPDEPTH like a count variable and calls some tests for each value.
#!/bin/bash
# SCRIPT ONE
CAPDEPTH=1
...
while [ $CAPDEPTH -lt 11 ];
do
echo "cap depth - $CAPDEPTH"
make test-all-basics
let CAPDEPTH=CAPDEPTH+1
done
And in line
eval "make test-all-basics"
It will do multiple calls to another shell script which I also want to make dependent on value of CAPDEPTH. Here are couple of lines from that script.
# SCRIPT TWO
...
R_binary="${R_HOME}/bin/exec${R_ARCH}/R"
capture_arg="--tracedir $(CAPDEPTH)"
...
My question is how to get the value of CAPDETH propagated from SCRIPT ONE to SCRIPT TWO. Is that even possible? I've tried export of the variable CAPDEPTH in both scripts, but does not seems to work.
eval? Why not justmake test-all-basicsdirectly?