• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

How to set an environment variable

Hi,

I'd like to set:

ANT_HOME to /usr/blah/ant


I'm using suse 8.3 and havn't been able to do it through the .profile - I added the line below:

ANT_HOME=/usr/blah/ant

can anyone let me know where I'm going wrong?

thanks
TimB

0
TimB
Asked:
TimB
1 Solution
 
naccadCommented:


export ANT_HOME=/usr/blah/ant

0
 
GnsCommented:
Or in the non-bash safer way of putting it (;-)
ANT_HOME=/usr/blah/ant
export ANT_HOME
-- Glenn
0
 
jimbbCommented:
TimB: also make sure that the file you put it in is actually being read at startup by your shell.

Bash, for example, has a particular logic to which of these files it reads, and in what order.  Check the "INVOCATION" section of the Bash man page for details.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
YawgmothCommented:
if you put this into your .profile file in your home dir you will not have to do this every time you open a shell or reboot
0
 
jimbbCommented:
You can't guarantee it's always going to be ~/.profile.  Read my comment. ;)
0
 
GnsCommented:
No, it's as jimbb says... If the shell is of the csh family, any of the above are just plain wrong too;-).
But a bourne shell is probable... even bash...

-- Glenn
0
 
CleanupPingCommented:
TimB:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now