View Single Post
  #4  
Old 8th August 2007, 13:42
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

Quote:
Originally Posted by mopsos
Hi,

I have a problem with the execution of a script in a script.
I want recover a variable in a script and test this in a other .

For exemple :
A script : sc1.sh
Code:
#!/bin/sh
var=3
A script : sc2.sh
Code:
#!/bin/sh
sh /folder/sc1.sh
if [ var -eq 3 ]
echo "goods"
fi
But this is bad.
I'd do it like this:

sc1.sh:

Code:
var=3
sc2.sh:

Code:
#!/bin/sh
. /folder/sc1.sh
if [ $var -eq 3 ]
echo "goods"
fi
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote