This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Linux / UNIX and the fly likes Setting up profile Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Setting up profile" Watch "Setting up profile" New topic
Author

Setting up profile

Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Hi guys, I thought /etc/profile was the best way to setup environment variables. But when I do this, it seems like that .bash_profile is still the one being used. How can I set environment variables so that it is widely used by any user in the system? Thanks!


SCJP 1.5
http://devpinoy.org/blogs/lamia/ - http://everypesocounts.com/
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

way 1)



way 2)


http://home.arcor.de/hirnstrom/bewerbung
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16101
    
  21

There's actually a whole chain of profiles and it varies somewhat between distros. /etc/profile is likely the one you want for global stuff; the .bash_profile in the user's home directory is executed when they login using bash as their initial shell (or "su" a new shell session), so you'd have to replicate things for each user. There's probably a global /etc/bash_profile as well for all bash users.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
GeeCON Prague 2014
 
subject: Setting up profile