LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 06-15-2014, 09:26 AM   #1
arthur_makowah
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 arthur.makowah@live.com
 
Old 06-15-2014, 09:32 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,823

Rep: Reputation: 611Reputation: 611Reputation: 611Reputation: 611Reputation: 611Reputation: 611
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.
  


Reply


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 05:05 AM
script to store comma seperated vales in different variables akhtar.bhat Programming 2 11-02-2009 01:02 AM
Information store: What software could I use to store and access various info merixon Linux - Software 2 12-17-2008 11:51 AM
permanently store PATH variables hiteshthappa Linux - Newbie 4 07-15-2008 08:59 PM
Permanently store PATH variables hiteshthappa Linux - Newbie 2 07-15-2008 03:09 AM


All times are GMT -5. The time now is 11:13 AM.

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