LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cannot view or access variables I store in b.a.s.h (https://www.linuxquestions.org/questions/linux-newbie-8/cannot-view-or-access-variables-i-store-in-b-a-s-h-4175508096/)

arthur_makowah 06-15-2014 09:26 AM

Cannot view or access variables I store in b.a.s.h
 
I am learning how to program the Bourne Again Shell and right now I am on variables. I declare my variables, and test them with echo, etc. Everything goes well. But as soon as I exit from my terminal, or logout, I can't access these variables anymore. I try to view them with echo but echo displays a blank msg and returns power to the shell. Please help me. I try to make my variables global, or readonly but nothing works. The same thing happens when I change the scope of my CDPATH Varible. Its only temporary. when i exit the shell and open it again, it retrurns to its original value. Im stuck. you can post replies to arthur.makowah@live.com

AlucardZero 06-15-2014 09:32 AM

that is how it works. you need to re-set them every time. you can do this in ~/.bash_profile or on the command line.


All times are GMT -5. The time now is 03:40 AM.