![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Accessing PL/SQL OUT variables in Korn Shell Script | bright_future | UNIX for Advanced & Expert Users | 4 | 12-02-2008 12:02 PM |
| Accessing Shell Variables in awk or sed | nasersh | Shell Programming and Scripting | 3 | 05-05-2008 08:44 AM |
| accessing shell script variable in file | HIMANI | UNIX for Dummies Questions & Answers | 6 | 08-07-2007 12:07 AM |
| Accessing var from .profile into shell script | videsh77 | Shell Programming and Scripting | 7 | 05-28-2005 01:21 PM |
| Accessing the home directory in shell script | krishan | SUN Solaris | 1 | 05-21-2005 01:41 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Accessing variables of one shell script in another shell script
Hi All,
I have a shell script called sample1.sh where I have 2 variables. Now I have another shell script called sample2.sh. I want the variables in sample1.sh to be available to sample2.sh. For example. In sample1.sh I am finding the sum of 2 numbers namely a and b. Now I want to access these variables in sample2.sh. Is this possible? How can I do this? Thanks in advance. |
|
||||
|
Quote:
Code:
. sample1.sh ..... If you have only variables in sample1.sh, then you can use above code, else keep all the variables in one file and replace sample1.sh by that file name in above code. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|