Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jul 2000 16:05:29 -0700
From:      Doug Barton <DougB@gorean.org>
To:        Jim Freeze <jim@freeze.org>
Cc:        questions@freebsd.org
Subject:   Re: declare -x
Message-ID:  <3980C039.3AB2A9EC@gorean.org>
References:  <Pine.BSF.4.21.0007271356350.93317-100000@web2.sea.nwserv.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Jim Freeze wrote:
> 
> I accidently discoverd that I can use
> 
> declare -x ENVVAR="value"
> 
> from a bash command line to set an environment variable.
> 
> However, I cannot find 'declare' in the man pages (so I don't know what
> the -x does) and I cannot run this in a script. Works only from the
> command line.

	It's a bash'ism. Items like this that don't appear in the system (only in
the shell) can usually be found in the man page for that shell. I don't
recommend using declare at all, it's much better to use export, since it
also works in sh scripts, and is portable across systems. 

HTH,

Doug


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3980C039.3AB2A9EC>