Sponsored Content
Full Discussion: Export Variable
Top Forums Shell Programming and Scripting Export Variable Post 302203883 by penchal_boddu on Tuesday 10th of June 2008 05:57:24 AM
Old 06-10-2008
Hi Navi,

I think the case is that ur calling some more scripts in the present script.

If this is the scenario , run the inner scripts with . ( dot ) operator.

If inner script name is child.sh

In the parent script, run as . child.sh

Then all the variables in the inner script will be exported to parent script

Thanks
Penchal
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Export command giving Variable Name vs the Value set for the Variable

I'm having an issue when I export within my program. I'm getting the variable name, not the variable value. I have a configuration file (config.txt) that has the values of the variables set as so: set -a export ARCHIVEPOSourceDir="/interfaces/po/log /interfaces/po/data" export... (2 Replies)
Discussion started by: ParNone
2 Replies

2. Shell Programming and Scripting

Export variable as number

Hi Guys, I am using the korn shell. I have an environments files where I have defined a variable export START_TIME=060000 export END_TIME=220000 I source this environments file into one of my scripts. The problem is that when I try to use this variable, I cannot get to use this variable as a... (2 Replies)
Discussion started by: zeus101
2 Replies

3. Shell Programming and Scripting

export variable question

simple question: for example if i use: export http_proxy=proxy:8080 and i have this script: while true; do .... lynx Google ;; wget The UNIX and Linux Forums - Learn UNIX and Linux from Experts ;; ... esac done So i must "export http_proxy=proxy:8080" before any lynx and wget... (4 Replies)
Discussion started by: aspire
4 Replies

4. Shell Programming and Scripting

Seeing variable which are exported with export

Greeting to all of you! I've small issue related to the variable which we are setting and exporting through scripts, in one of the script there are some variable used but I am not abel to get the detail as where they are set. I tried finding the detail with the help of env but no luck. ... (2 Replies)
Discussion started by: kumarmani
2 Replies

5. Shell Programming and Scripting

Export variable

Hi I have a pass a variable from one script to another. Here are my scripts Script #1 ./profile #!/bin/sh export NAME="Hello" Script #2 ./test #!/bin/sh ./profile echo $NAME when I run ./test .. i am not getting anything .. why is that? (5 Replies)
Discussion started by: arex876
5 Replies

6. Shell Programming and Scripting

where does variable export to?

Hi, Unix Gurus, I have a problem need help. I have a script to generate environment variable code same as following: oracle_sid=abcd export oracle_sid when I execute this code with command ./script_nane it succeeded. when I try to find it with env command or echo $oracle_sid, it does not show... (5 Replies)
Discussion started by: ken002
5 Replies

7. Shell Programming and Scripting

help t export the variable from a particular file

Hello Guys, I need you help to do one task I have script which is actually doing to fetch the code of any repository in svn for e.g.:- I can use svn to checkout the repository but I want to checkout the repository for particular tag like svn co <url>/svn/repo/<tag-name> and this... (1 Reply)
Discussion started by: rohit22hamirpur
1 Replies

8. Shell Programming and Scripting

export variable not working after su

I have a requirement to change user inside a shell script and execute group of commands. I have done it many times earlier but never came across the issue with exporting variables. Strangely if a var is exported afetr su, it is not working where as if it is does outside su, it works. Another issue... (8 Replies)
Discussion started by: sasiharitha
8 Replies

9. Shell Programming and Scripting

Can't export variable

I am relatively new to exporting variables, and I just can't seem to make this count work. What I have is the following: TOTAL=$($IMAGELIST -backupid $IM -U |gawk '{print $5}' |tail -1)|gawk '{print $6}' RESTORED=$($BPDBJOBS -most_columns -jobid $JOBS |cut -f15 -d,) |gawk '{print $6}' export... (7 Replies)
Discussion started by: newbie2010
7 Replies

10. UNIX for Advanced & Expert Users

Need help export variable

Hi, Please find my code below. ps -xef | grep 14766 | awk 'BEGIN{X="java_home=";X="weblogic_home="} {for(i=1;i<=NF;i++){if($i ~ /-Dplatform\.home|java$/){split($i,P,"=");s=P?P:$i;print X""s}}}' echo "java_home="$java_home echo "weblogic_home="$weblogic_home Output: Why does... (3 Replies)
Discussion started by: mohtashims
3 Replies
Perl6::Export::Attrs(3pm)				User Contributed Perl Documentation				 Perl6::Export::Attrs(3pm)

NAME
Perl6::Export::Attrs - The Perl 6 'is export(...)' trait as a Perl 5 attribute VERSION
This document describes Perl6::Export::Attrs version 0.0.3 SYNOPSIS
package Some::Module; use Perl6::Export::Attrs; # Export &foo by default, when explicitly requested, # or when the ':ALL' export set is requested... sub foo :Export(:DEFAULT) { print "phooo!"; } # Export &var by default, when explicitly requested, # or when the ':bees', ':pubs', or ':ALL' export set is requested... # the parens after 'is export' are like the parens of a qw(...) sub bar :Export(:DEFAULT :bees :pubs) { print "baaa!"; } # Export &baz when explicitly requested # or when the ':bees' or ':ALL' export set is requested... sub baz :Export(:bees) { print "baassss!"; } # Always export &qux # (no matter what else is explicitly or implicitly requested) sub qux :Export(:MANDATORY) { print "quuuuuuuuux!"; } IMPORT { # This block is called when the module is used (as usual), # but it is called after any export requests have been handled. # Those requests will have been stripped from its @_ argument list } DESCRIPTION
Implements a Perl 5 native version of what the Perl 6 symbol export mechanism will look like. It's very straightforward: o If you want a subroutine to be capable of being exported (when explicitly requested in the "use" arguments), you mark it with the ":Export" attribute. o If you want a subroutine to be automatically exported when the module is used (without specific overriding arguments), you mark it with the ":Export(:DEFAULT)" attribute. o If you want a subroutine to be automatically exported when the module is used (even if the user specifies overriding arguments), you mark it with the ":Export(:MANDATORY)" attribute. o If the subroutine should also be exported when particular export groups are requested, you add the names of those export groups to the attribute's argument list. That's it. "IMPORT" blocks Perl 6 replaces the "import" subroutine with an "IMPORT" block. It's analogous to a "BEGIN" or "END" block, except that it's executed every time the corresponding module is "use"'d. The "IMPORT" block is passed the argument list that was specified on the "use" line that loaded the corresponding module. However, any export specifications (names of subroutines or tagsets to be exported) will have already been removed from that argument list before "IMPORT" receives it. DIAGNOSTICS
%s does not export: %s use %s failed You tried to import the specified subroutine, but the module didn't export it. Often caused by a misspelling, or forgetting to add an ":Export" attribute to the definition of the subroutine in question. Bad tagset in :Export attribute at %s line %s: [%s] You tried to import a collection of subroutines via a tagset, but the module didn't export any subroutines under that tagset. Is the tagset name misspelled (maybe you forgot the colon?). Internal error: missing symbol for %s A subroutine was specified as being exported during module compilation but mysteriously ceased to exist before the module was imported. CONFIGURATION AND ENVIRONMENT
Perl6::Export::Attrs requires no configuration files or environment variables. DEPENDENCIES
This module requires the Attribute::Handlers module to handle the attributes. INCOMPATIBILITIES
None reported. BUGS AND LIMITATIONS
No bugs have been reported. Note that the module does not support exporting variables. This is considered a feature, not a bug. See Chapter 17 of Perl Best Practices (O'Reilly, 2005). Please report any bugs or feature requests to "bug-perl6-export-attrs@rt.cpan.org", or through the web interface at <http://rt.cpan.org>. AUTHOR
Damian Conway "<DCONWAY@cpan.org>" LICENCE AND COPYRIGHT
Copyright (c) 2005, Damian Conway "<DCONWAY@cpan.org>". All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. DISCLAIMER OF WARRANTY
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. perl v5.10.1 2011-04-22 Perl6::Export::Attrs(3pm)
All times are GMT -4. The time now is 09:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy