View Single Post
  #3  
Old 8th August 2007, 11:32
geekman geekman is offline
Member
 
Join Date: Sep 2006
Location: Sydney, Australia
Posts: 56
Thanks: 1
Thanked 10 Times in 10 Posts
Send a message via ICQ to geekman Send a message via MSN to geekman
Default

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.
Reply With Quote