getting vars from external files

Hi I have an issue, I want to get variables from an external file. Variable file var1=test var2-test2 I want to get these vars from another shell script. Does any one know how?

Make the file like this

var1=test
var2=test2

then you just do . configfile in your script and it sets the variables.

Could you explain in more detail. Cheers

What is it that's not clear?

config called config.txt file contains var1=test1 var2=test2 shell script contains . contfig.txt it this right?

that's correct - just as Corona688 has explained. The name of a file doesn't matter as long as you the same name when 'sourcing' it with . myFileWithVariables