[Eug-lug] Shell scripts to export environment variables?
Bob Miller
kbob at jogger-egg.com
Tue Feb 26 23:24:20 PST 2008
Rob Hudson wrote:
> On 2/26/08, Fred James <fredjame at fredjame.cnc.net> wrote:
> > ... "source" the file as ...
> >
> > . filename
>
> That works for me. I'm mostly looking for a way to set those
> variables and not have to remember the exact details every time.
Another popular technique is for the subprocess to print the commands
to set the variables, then from the login shell you "eval" the output.
E.g.,
~> printenv LS_COLORS
~> dircolors -c
setenv LS_COLORS
'no=00:fi=00:di=01;34:ln=01;36:...
~> eval `dircolors -c`
~> printenv LS_COLORS
no=00:fi=00:di=01;34:ln=01;36:...
Note that I'm using csh. For bash, use "dircolors -b".
--
Bob Miller K<bob>
kbob at jogger-egg.com
More information about the EUGLUG
mailing list