Welcome to the most active Linux Forum on the web.
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 06-15-2014, 10:26 AM   #1
LQ Newbie
Registered: Jun 2014
Location: Beijing
Distribution: Kali Linux
Posts: 3

Rep: Reputation: Disabled
Unhappy 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
Old 06-15-2014, 10:32 AM   #2
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 614Reputation: 614Reputation: 614Reputation: 614Reputation: 614Reputation: 614
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.
1 members found this post helpful.


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
i need to store the outputs of 2 commands in 2 variables and compare the two variable anurupr Linux - Newbie 10 03-04-2010 06:05 AM
script to store comma seperated vales in different variables akhtar.bhat Programming 2 11-02-2009 02:02 AM
Information store: What software could I use to store and access various info merixon Linux - Software 2 12-17-2008 12:51 PM
permanently store PATH variables hiteshthappa Linux - Newbie 4 07-15-2008 09:59 PM
Permanently store PATH variables hiteshthappa Linux - Newbie 2 07-15-2008 04:09 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:30 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration