how to setenv using Bourne .sh

Aiza aiza21 at comclark.com
Sat Jul 10 11:41:43 UTC 2010


Polytropon wrote:
> On Sat, 10 Jul 2010 10:53:17 +0800, Aiza <aiza21 at comclark.com> wrote:
>> Trying the set the pkg_add environment variable PKGDIR using this
>>
>>
>> setenv PKGDIR="/usr/packages"  and get this error message
>> setenv: Syntax Error.
> 
> Of course. The sh shell doesn't have setenv.
> 
> 
> 
>> man setenv is useless.
> 
> The manual entry of setenv can be found in "man csh". :-)
> 
> 
> 
>> The question is how do I set a environment variable using the default 
>> freebsd shell?
> 
> You mean: FreeBSD's default scripting shell. :-)
> 
> 	$ PKGDIR="/usr/packages"
> 	$ export PKGDIR
> 
> or
> 
> 	$ export PKGDIR="/usr/packages"
> 
> Refer to "man sh" for details. The setenv command is a built-in for
> the C Shell.
> 
> 
> 
When I put export on the console command line I get this message
export: Command not found.

But I was able to get setenv and unsetenv to work this way

setenv PKGDIR "/usr/packages/"
unsetenv PKGDIR
and just setenv shows me everything already set.


More information about the freebsd-questions mailing list