Date: Wed, 7 Mar 2007 08:08:35 -0800 (PST) From: Drew Jenkins <drewjenkinsjr@yahoo.com> To: freebsd-questions@freebsd.org Subject: Re: Setting Env Message-ID: <821143.79253.qm@web62215.mail.re1.yahoo.com>
next in thread | raw e-mail | index | archive | help
>> ----- Original Message ----=0A>> From: Jerry McAllister <jerrymc@msu.edu= >=0A>> To: Drew Jenkins <drewjenkinsjr@yahoo.com>=0A>> Cc: freebsd-question= s@freebsd.org=0A>> Sent: Tuesday, March 6, 2007 7:46:26 PM=0A>> Subject: Re= : Setting Env=0A>>=0A>> >If you want the environment variable to=0A>> >be s= et for something that is taking place in the script, then=0A>> >that variab= le must either be set in a durable way in the parent=0A>> >environment or b= e set right there in the script that is using it.=0A>> >The rc.conf method = will make it available from the parent.=0A>> >That is the whole point of rc= .conf.=0A>>=0A>> Right. I figured that much. So, what do I actually put in = that file? I=0A>> tried these two options:=0A>>=0A>> setenv LD_LIBRARY_PATH= /usr/local/lib/mysql/=0A>>=0A>> export LD_LIBRARY_PATH=3D"/usr/local/lib/m= ysql/"=0A>>=0A>=0A>Well, setenv is a csh or tcsh command and isn't in sh an= d probably=0A>not in bash either (I haven't used bash).=0A>=0A=0AI am aware= of that. I was trying to explain how I used every_possible_combination of = things I could think of!=0A=0A>The export command is an sh and probably bas= h command and it=0A>doesn't exist in csh or tcsh.=0A>=0A=0AYes, yes. I know= .=0A=0A>=0A>>=0A>> It didn't like either, presumably because it's not calli= ng a bash or c-shell.=0A>> So, what should I put in /etc/rc.conf that will = achieve my objective?=0A>=0A>Look at other variable setting in rc.conf. Th= at should give you=0A>a good clue. For example, in my rc.conf I have seve= ral. One is:=0A> moused_enable=3D"YES"=0A>That makes the moused_enable va= riable have a value of YES.=0A>So, if you want LD_LIBRARY_PATH to have the = value of /usr/local/lib/mysql/=0A>might that not be:=0A> LD_LIBRARY_PATH= =3D"/usr/local/lib/mysql/"=0A>=0A=0AI tried that and posted yesterday that = that failed.=0A=0A>If you put it in the script that starts things - there n= eeds to be one -=0A>then it depends on the script language, csh/tcsh sh/bas= h.=0A>csh/tcsh use setenv and set=0A>sh [and bash] use set and variable_na= me=3Dvalue and needs an export to=0A>make it available to other entities be= sides the shell itself.=0A>You should look up the man pages on these things= and take a look=0A>at some other scripts such as those in /usr/local/etc/r= c.d for=0A>examples.=0A=0AWhat *things*? As far as scripts, this *should* b= e easy...=0A=0A#!/bin/csh=0Asetenv LD_LIBRARY_PATH /usr/local/lib/mysql/=0A= =0A...right? It doesn't work. Any other ideas?=0ADrew=0A=0A=0A=0A =0A______= ___________________________________________________________________________= ___=0ANever miss an email again!=0AYahoo! Toolbar alerts you the instant ne= w Mail arrives.=0Ahttp://tools.search.yahoo.com/toolbar/features/mail/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?821143.79253.qm>