Smartboy wrote:
> On Thu, Aug 13, 2009 at 7:58 AM, James Robertson <[email protected] 
> <mailto:[email protected]>> wrote:
> 
>     All
> 
>     I know that this list is for LFS support, but I figured that I can get
>     my question answered here better than anywhere else, so please bear with
>     me.
> 
>     I am writing a shell script for another package I downloaded
>     (ntlm-aps).  As part of the script I issue this command:
> 
>     export http_proxy=http://127.0.0.1:5865
> 
>     like I would in a profile file (/etc/profile or ~/.bash_profile) to set
>     an environment variable.  The issue I am having is the variable does not
>     stay resident in my env after the script is finished running.  I can add
>     the export to my ~/.bash_profile file and it works when I logon, but the
>     variable is only good when ntlm-aps is running in memory so that is why
>     I want it to be set when I run the script and not at logon.
> 
>     Any ideas?

I presume that your are in an interactive shell and want the variable to 
remain active there?

The best way is to execute a shell from the terminal with the "source" 
or "." command. The shell that contains the "export xxx=yyy ..." can 
then call the real shell to do the work, if you want to *not* tie up 
your interactive shell, and put it in background with the "&". If you 
want it immune to interrupts too, precede the call with "nohup". If you 
want to save the output of the command somewhere, use I/O redirection, e.g.
    &> /tmp/myfile

"man nohup"
"man bash"

> 
>     Thanks in advance
>     James
><snip sig stuff>

HTH
-- 
Wit
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to