The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Executing Multiple .SQL Files from Single Shell Script file anushilrai Shell Programming and Scripting 3 04-07-2008 07:09 AM
executing shell file in jva + tomcat jaganadh Shell Programming and Scripting 1 10-20-2007 03:58 PM
Post Shell programming: Question about source a file and read data from the file ccwq Shell Programming and Scripting 3 08-04-2007 07:28 PM
Reading file names from a file and executing the relative file from shell script anushilrai Shell Programming and Scripting 4 03-10-2006 02:25 AM
file activity (open/closed) file descriptor info using KORN shell scripting Gary Dunn UNIX for Dummies Questions & Answers 3 06-07-2004 10:54 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 06-19-2007
Registered User
 

Join Date: May 2007
Posts: 29
Executing shell file within another shell file

Hello Everybody

I have a shell script file which contains certain intialisation.Initialisation section is around 20 lines.This initialisation section is required by 20 shell script files.

Intialisation shell script contains only initialisation of variables and it is not a good practise to deplicate the same script in all 20 shell script

Instead of that i want to call single initialisation script file in all 20 shell script which used it.

Kindly tell me how to go about it.

For example , below is section of initialisation section which have variable named CLASSPATH and this entire scripting is available in a single shell scrip file.

Code:
CLASSPATH=/opt/programs/appl/:
CLASSPATH=${CLASSPATH}:.
CLASSPATH=${CLASSPATH}:<APPL_DIRECTORY>/lib/log4j-1.2.14.jar
Now i need to call this shell script inside another shell script and also want to access the variable CLASSPATH.

How to do it ...

Reply is very much appreciated
Reply With Quote
Forum Sponsor
  #2  
Old 06-19-2007
Registered User
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,397
Your_script
Code:
. /path/script_containing_variables
......
Leave a space between dot and script name
Reply With Quote
  #3  
Old 06-19-2007
Registered User
 

Join Date: May 2007
Posts: 29
Thanks very much ...it is working ..i really appreciate for ur valuable reply
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:05 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0