So if I understand you correctly, you want to pass one variable onto another script? Theres two ways that come to mind straight away:
* Lets say the two scripts are in the same directory...
Example 1
----------
Script 1:
Code:
#!/bin/sh
returnvar=1
echo $returnvar
Script 2:
Code:
#!/bin/sh
# This should set $var to whatever script1 outputs.
var=`./script1`
echo Passed: $var
Example 2:
----------
Script 1:
Code:
#!/bin/sh
returnvar=3
#We are sending $returnvar as the first argument to script2
./script2 $returnvar
Script 2:
Code:
#!/bin/sh
echo Passed $1
From my experience in a debian environment this would likely work, no idea what you are using, though none of this has been tested.
Thanks, hope it helps.
Recent comments
4 hours 9 min ago
5 hours 8 min ago
8 hours 55 min ago
10 hours 9 min ago
13 hours 46 min ago
21 hours 1 min ago
1 day 5 hours ago
1 day 7 hours ago
1 day 22 hours ago
2 days 54 min ago