Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to call Variable from another file.

Status
Not open for further replies.

ranjank

IS-IT--Management
May 9, 2003
176
0
0
IN
Hi All,

I want to call a variable defined in the another file.For E.G

cat tomcat

VERSION=test
ABC=mmm
BCD=nnn
......

I want to call variable VERSION in spec file.Is there any way i can do it.Any pointers on this will be of great help.

Regards,
Ranjan.
 
If you "source" the tomcat file in the spec file, you will inherit all variables

For Korn, Bourne, bash shell go like this

Code:
# # #
# source variables from tomcat file
. /path/to/file/tomcat
# # #
# now use any variable defined in tomcat file
echo $VERSION
...


HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top