Setting environment variables inside a bash script

Antonio Oliveira to.oliveira at gmail.com
Sun Oct 1 00:20:27 UTC 2006


Hello everyone.

I am having a problem trying to set up some environment variables
in /etc/rc.local

here is my file

#!/usr/bash

FOO="bar"
export FOO

<EOF>

If I run /etc/rc.local I get absolutely no error messages, but calling env
doesn't show the variable 'FOO' doing echo $FOO prints nothing.

If I simply type {export FOO="bar"} in the bash shell and try to echo $FOO
the variable has the correct value.

What am I doing here.

I'm using Edgy testing.

Cheers
--to





More information about the ubuntu-users mailing list