Hi,
Sure you can. Take a look at the following two shell scripts:
in "shell1" (executable bash shell script)
Code:
#! /bin/bash
Var1="1"
Var2="3"
Var3=`shell2 $Var1 $Var2`
echo "Var3: " $Var3
in "shell2" (executable bash shell script)
Code:
#! /bin/bash
Var1=`expr $1 + $2`
echo $Var1
You can see that shell1 sets up a few variables and passes those variables to shell2. shell2 takes those variables as input arguments, sums them and echos the results. shell1 gets the echoed data from shell2 and assigns it to a third variable. shell1 then goes on to echo out the results to the screen.