The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > BSD
Google UNIX.COM
Home Forums Register Rules & FAQ Members List Arcade Search Today's Posts Mark Forums Read


BSD BSD, sometimes called Berkeley Unix, is a Unix operating system developed by the Computer Systems Research Group of the UC Berkeley.


Other UNIX.COM Threads You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
export issue ravi raj kumar Shell Programming and Scripting 2 02-19-2008 04:53 AM
export??? Justinkase Shell Programming and Scripting 1 12-03-2007 02:32 PM
Mount Export AIXdumb455 UNIX for Dummies Questions & Answers 1 06-20-2006 12:08 AM
confusion with export kdipankar Shell Programming and Scripting 1 05-11-2006 02:07 AM
difference between set and export shriashishpatil UNIX for Dummies Questions & Answers 1 02-22-2006 09:28 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-21-2008
Registered User
 

Join Date: Jan 2008
Location: Bangalore,India
Posts: 126
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Arrow How to export

Hi

I need to export some directpry path like below:

var1=/<>/<>/<>
export var1

This is my basic idea.
I tried export var1=/<>/<>/<>
after executing this in a shell i did an echo of the var1. But nothing happened.

Can you please help me with this.

I need to srite a script to export multiple directory files..

Thanks in advance
JS
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 01-21-2008
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,627
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
What you have done seems right.

Did you do that in a shell script ? If so, you will have to source that shell script to see the changes in your shell.

Code:
source myscript.sh
What did you do ?
Reply With Quote
  #3 (permalink)  
Old 01-21-2008
Registered User
 

Join Date: Jan 2008
Location: Bangalore,India
Posts: 126
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Hi Vino,
Thanks
Yes . I have done that in a shell script.
The below script got executed successfuly
i have the following in 1.sh
export var1=/<>/<>/<>
export var2=/<>/<>/<>
./2.sh

And i have the following in 2.sh
echo $var1

when i run 1.sh i get the echo run

But wat i wanted was
vi 1.sh
export var1=/<>/<>/<>
export var2=/<>/<>/<>

after i run the above script if i give aecho of var1 then it sholud give me the dir path

But this doesnot work.
It looks like the exporting is available to only the subscripts and once we come out of 1.sh(in the secondcase) the effect of export is lost .

Thanks in advance
Reply With Quote
  #4 (permalink)  
Old 01-21-2008
Registered User
 

Join Date: May 2006
Posts: 41
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
hello,

Please run like this :
$ . ./1.sh
So whatever export variables inside the script 1.sh will be available in the shell.

Regards,
Thobias
Reply With Quote
  #5 (permalink)  
Old 01-21-2008
Registered User
 

Join Date: Jan 2008
Location: Bangalore,India
Posts: 126
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Thank you for the answer
Regards
Reply With Quote
Google UNIX.COM
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 09:41 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger

Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102