Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Posts
    4

    Unanswered: 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

  2. #2
    Join Date
    Jun 2002
    Location
    UK
    Posts
    525

    Re: Global Variable declaration

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •