If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Global Variable declaration

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-02-03, 01:12
chakicherla chakicherla is offline
Registered User
 
Join Date: Sep 2003
Posts: 4
Global Variable declaration

Hi all,

If I want to declare global variables in shell script what should I do?

For example:

If I have a file called "env.rc", which contains set of variable declarations.

Now, if I have a program called 'A' which calls the script "B" which in turn calls script "C".

I want to have all the variables declared in all the scripts. For this, I need to run the "env.rc" in each & every script or can we run this globally in one, so that it applies to all the scripts.

Advice me.

Regards
CKC
Reply With Quote
  #2 (permalink)  
Old 10-02-03, 04:22
Damian Ibbotson Damian Ibbotson is offline
Padawan
 
Join Date: Jun 2002
Location: UK
Posts: 525
Re: Global Variable declaration

Quote:
Originally posted by chakicherla


I want to have all the variables declared in all the scripts. For this, I need to run the "env.rc" in each & every script or can we run this globally in one, so that it applies to all the scripts.
Source env.rc in your scripts, e.g.

. env.rc


Damian
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On