![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Linux Support Linux - Operating Systems and Applications Support |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Aug 2007
Posts: 76
OS: Windows Vista Home Premium
|
I have a variable called ARCHIVE defined in my logon script, so whenever I'm in a shell i can type "echo $ARCHIVE" to print the value of the variable. Problem: I need to write a script that uses the value of this variable, but every time I try to use it in the script it looks for an ARCHIVE defined in the script, so it has a null value. for example, I say "dir=$ARCHIVE", and it sets dir to the null string because ARCHIVE is not defined in the script. I understand that the script runs in its own shell, but since the variable gets defined in my logon script shouldn't it be available to any shell?
|
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
|
|
#2 (permalink) |
|
Registered User
Join Date: Oct 2007
Location: Littleton, Colorado USA
Posts: 470
OS: xp 64 sp2 Fedora Core 8 (vmware xp core 8 x32) Minix
|
Re: Special shell variables in bash script
You need to export it.
Declare ARCHIVE as: export ARCHIVE=this-is-an-archive Then ARCHIVE will get exported to the child shell. |
|
|
|
![]() |
| Thread Tools | |
|
|