Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm having some troubles to understand the env command.
I know that env is to set environment variables.
1 - The variables are declared in any special file?
2 - If I've a .bashrc or a .bash_profile in my user directory, the content of this values (eg. JAVA_HOME=/opt/jdk1.6.0_01; PATH=$PATH:$JAVA_HOME/bin; export PATH) will prevail over the environment variables defined?
3 - What's the difference between .bashrc and .bash_profile?
4 - In my bash_profile I've the following:
Code:
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
JAVA_HOME=/opt/jdk1.6.0_01
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export PATH
unset USERNAME
What's reason of the export command? What means the "unset USERNAME" line?
env - run a program in a modified environment
[snip] Set each NAME to VALUE in the environment and run COMMAND.
... it allows you to modify the environment for a particular program/command only. To set or change an environment variable, for all subsequent programs, you use the export command:
from export(1)
export sets the export attribute on each of the variables specified by name which causes them to be in the environment of subsequently executed commands. If =value is specified, the variable name is set to value.
from unset(1)
unset - unset values and attributes of variables and functions
... in this case it appears to remove USERNAME from the environment
from bash(1)
[snip]
the system wide initialization file /etc/bash.bashrc and the standard personal initialization file ~/.bashrc if the shell is interactive (see INVOCATION below).
[snip]
the system-wide startup file /etc/profile or any of the personal initialization files ~/.bash_profile, ~/.bash_login, or ~/.profile. By default, bash reads these files when it is invoked as a login shell (see INVOCATION below)
... which should answer the questions about bashrc and bash_profile, especially if you go read the bit about invocation in the manpage.
Last edited by Simon Bridge; 05-16-2007 at 06:30 AM.
Off-topic, sorry: Simon, how did you get monospace w/o using a "Code" block? Specifically what OS/browser combo. are you using? I can't get LQ "Fonts" to function in MEPIS/Konq. 3.3.2.
Tried in MEPIS 6.0/Konq. 3.5.3 -- even worse. WTFO, there I'm using as up to date a browser/OS as can reasonably be expected & it still doesn't work.
I did click the "quote" button, that's why I asked the Q . The problem is, when I click the "Fonts" drop down the selector doesn't work. I can type the entire tag set & it works.
This (Advanced) edit done in Opera 9.01
Some font tests:
Century Gothic?
Arial Black?
Franklin Gothic Medium?
Times New Roman?
System?
monospace = Arial
monospace = Arial Narrow
monospace = Courier New
monospace = courier (entered manually)
In "Preview Changes" (in Opera 9.01) all of the above, particularly Arial & Arial Narrow, look the same except that "Times New Roman" is serifed & "Courier New" & "courier" seem to be monospaced, at least they are narrower than the others.
Note: If you don't understand my examples, or what I'm trying to show, Simon says 'click the "quote" button'. (Couldn't resist that one, although I'm sure Simon is tired of it. )
This (Advanced) edit done in Konq. 3.3.2
Only plain "courier" looks different, all of the rest look the same, i.e. do not display as intended, in this browser.
This (Advanced) edit done in <spew>M$IE 6</spew>
As you can see, I am committing heresy for the sake of knowledge.
All the fonts are displayed correctly above, as well as in the dropdown; & of course the dropdown works.
WTFO, a premier Linux site that that works best w/ the browser the experienced membership should be least likely to use? Apologies for the emotional outburst, but I am, to say the least, taken aback. (Well, at least Spell Check doesn't work as well in M$IE as in Konq. & Opera.)
Last edited by archtoad6; 05-19-2007 at 07:44 AM.
Reason: add browser specific notes & examples
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.