![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Confusion about 1>&2 and 2>&1 | navi | Shell Programming and Scripting | 1 | 06-03-2008 07:26 AM |
| 'tr' confusion | Nafanja | UNIX for Dummies Questions & Answers | 2 | 12-05-2007 07:47 PM |
| Sed confusion | alfredo123 | Shell Programming and Scripting | 3 | 11-17-2006 08:16 AM |
| ftp confusion | intern | UNIX for Dummies Questions & Answers | 1 | 06-08-2006 03:20 PM |
| ISO Confusion? | Mr_Pinky | UNIX for Dummies Questions & Answers | 6 | 09-19-2005 03:14 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
confusion with export
Hi,
I have written the following two scripts. a.ksh ---> FPATH=/users/kushard autoload b b echo "From a.ksh::" $aa b ---> function b { typeset aa aa="TRUE." echo "From b::" $aa export aa } But I cannot see the value of aa being populated in a.ksh. Please let me know where I am wrong. regards, Dipankar. |
| Forum Sponsor | ||
|
|
|
|||
|
o/p is correct
The o/p is correct. export means - let the variable value be known to its subshells. 'b' is called from a.ksh(parent). So, what the child exports is not visible to parent.
I tried writing a function 'c' - function c { echo "Called form c::$aa" } Called it from 'b' and it worked -- function b { typeset aa aa="TRUE." echo "From b::" $aa export aa autoload c c } Now when I run the a.ksh - I get From b:: TRUE. Called form c::TRUE. From a.ksh:: I hope I am clear. |
|||
| Google The UNIX and Linux Forums |