The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 10:09 AM
executing shell file in jva + tomcat jaganadh Shell Programming and Scripting 1 10-20-2007 06: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 10: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 05:25 AM
file activity (open/closed) file descriptor info using KORN shell scripting Gary Dunn UNIX for Dummies Questions & Answers 3 06-07-2004 01:54 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-19-2007
appleforme1415 appleforme1415 is offline
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
  #2 (permalink)  
Old 06-19-2007
anbu23 anbu23 is offline Forum Advisor  
Registered User
  
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,398
Your_script
Code:
. /path/script_containing_variables
......
Leave a space between dot and script name
  #3 (permalink)  
Old 06-19-2007
appleforme1415 appleforme1415 is offline
Registered User
  
 

Join Date: May 2007
Posts: 29
Thanks very much ...it is working ..i really appreciate for ur valuable reply
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:31 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0