This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Linux / UNIX and the fly likes permanent env varibales set up in bash shell Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "permanent env varibales set up in bash shell" Watch "permanent env varibales set up in bash shell" New topic
Author

permanent env varibales set up in bash shell

arun ramk
Greenhorn

Joined: Aug 09, 2008
Posts: 26
Hi friends,


Please let me know how to set up environmental variables in bash shell in linux.....
i need to setup environmental variables for java and oracle installations

i used export command....... but the variables exist only for that session........

please help
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874



Arun,

1) Reach the home directory. and search for /.bash_profile file.
2) Open in vi (or other prefered) editor
3) Add the env variables , save it
4) run ./.bash_profile or logout and login
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15961
    
  19

Note: "/.bash_profile" refers to a file at the root of the filesystem. What you actually want to edit is one of the following:

~/.bash+profile

$(HOME)/.bash_profile

/home/xxxx/.bash_profile (where xxxx is your home directory name)

These are all references to the same file, but the first 2 are abbreviations provided by bash.


Customer surveys are for companies who didn't pay proper attention to begin with.
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874


yeah ~/.bash_profile , here ~ is home directory.

[typo error in my previous post.]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: permanent env varibales set up in bash shell
 
Similar Threads
I need help with scanner
what file is read when a terminal shell is started.
Bash Shell and string.split
Need unix shell script Help
path