[SOLVED] Why is the environment variable set in .bash_profile is not being in effect ?
Linux - NewbieThis 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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Why is the environment variable set in .bash_profile is not being in effect ?
Hi All, I am new to Linux and I got an opportunity to work on Linux now. I am quite excited, but had to post this simple question for all of you.
We had DB2 software installed in a specific directory /IBM/db2/V9.7/bin and my PATH variable isn't set for this. So, for all the db2 commands I have to type the path with command. So, I have updated the PATH variable at $ prompt and exported the variable, and it worked successfully. But after I logged off and logged back in, I had to do it again. So, with little knowledge and searching around I found .bash_profile where I could append the path to existing PATH. So, i have updated the .bash_profile with PATH=$PATH:/IBM/db2/V9.7/bin and logged off and logged back in again. Still I do not see the changes for the PATH variable taking effect from my .bash_profile. So, wondering if there is something else I need to do. Please let me know if you have any ideas on how I could get this resolved.
bash_profile is usually read by login shells, but not by non-login interactive shells. Those generally use bashrc. Read the INVOCATION section of the bash man page for details on the start-up files used in your distribution.
Thank you for the information. I have tried .bashrc also, and it is still not working. So, I am reading the books now to see if there is anything else, and will post the answer as soon as I find the solution.
What you have described should work. If your ~/.bash_profile contains
then the PATH should be modified.
How to diagnose the problem? One possibility is that PATH is being set to some other value later. To see what is happening you could add set -x at the beginning of ~/.bash_profile and log on at a virtual console (accessed from a graphical desktop by Ctrl+Alt+F1 or F2 ... Get back to the graphical desktop by typically Ctrl+Alt+F7 but try others if that doesn't work).