Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-23-2008, 03:04 PM   #1
LQ Newbie
Registered: Dec 2008
Posts: 1

Rep: Reputation: 0
Setting up environment variables

What is the difference between setting up environment variables by editing .bashrc (or/etc/bash.bashrc) file and /etc/profile file (apart from setting up for single user and all user)?
Bash is a type of shell. So will editing .bashrc or or bash.bashrc file make changes only to shell run commands/applications? Or will the changes get applied to applications like eclipse (not invoked from the command line)?

Old 12-23-2008, 04:17 PM   #2
Registered: Sep 2007
Location: Berlin
Distribution: Slackware
Posts: 509

Rep: Reputation: 41
It depends on your login mechanism and the shell you use.

.bashrc certainly only makes sense if you're actually use bash - you might change to tcsh or csh or zsh or whateversh and they don't load .bashrc - they have a .tcshrc or .cshrc and so on. Other shells may also have a different syntax to set environment variables - what's "export" in bash is "setenv" in tcsh, for example.

There may be a local .bashrc, .bash_profile, .bash_login (sticking with bash as an example here..) and a .bash_logout and the .profile.

See "man bash" the section about "invocation" for details and for which file is loaded depending on what.

Wether or not it influences only command line application depends usally on how you login and invoke your X and afterwards if you use your command line in an xterm it depends on how you invoke your xterminal program.

An environment has to be set somewhere to be read by an application later on. Eclipse probably doesn't care where your environment comes from as long as the environment itself is correct - CLASSPATH 'n'stuff I assume.

Many people stumble upon this when they see a difference in loading some X application via some menu or icon or if they start it from within their xterminal.


linux, path, variables

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
setting Environment variables? muby Linux - Newbie 5 10-02-2007 05:21 AM
Setting and getting environment variables??? Sulman Shah Fedora 2 12-13-2006 06:33 PM
Setting Environment Variables rbh123 Linux - Newbie 2 10-03-2005 06:34 PM
Setting Environment Variables farzan Linux - Newbie 2 08-07-2004 09:13 AM
setting environment variables durden2.0 Linux - Newbie 5 07-15-2003 01:57 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:57 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration