Is there a way to set environment variables from within a (bash) shell script?
I want to set some environment variables on some servers using a small script rather than typing. Some forum posts believe it is impossible.
Any Ideas?
Is there a way to set environment variables from within a (bash) shell script?
I want to set some environment variables on some servers using a small script rather than typing. Some forum posts believe it is impossible.
Any Ideas?
file export_FOOBAR:
# set variable FOOBAR to "hi"
FOOBAR=hi
export FOOBAR
at the prompt
yourhost:/~ > source export_FOOBAR
For Bash built-ins, use the built-in help. E.g.:
$ help source
To see if a command will be handled by the shell (is a built-in), use the type bash built-in:
$ type help
$ type type