Fedora Linux Support Community & Resources Center
  #1  
Old 18th August 2011, 03:02 PM
ask4nutz Offline
Registered User
 
Join Date: Dec 2009
Location: Philadelphia
Posts: 59
linuxchrome
change bash from terminal

I have been temporarily changing environment variables using 'export DIR=foo' but I know there is a way to have the variable permanently set in .bashrc. Any ideas? Thanks!
__________________
draft beer, not people
Reply With Quote
  #2  
Old 18th August 2011, 04:59 PM
Oxyd Online
Registered User
 
Join Date: Dec 2004
Location: Prague, Czech Republic
Age: 26
Posts: 7
freebsdchrome
Re: change bash from terminal

Yes, you can set it permanently in .bashrc the same way you did it interactively: just put export VAR=value in your .bashrc.

Bash automatically reads and evaluates .bashrc every time you start it up, so by putting the line there, the variable will be set every time you launch new bash.
Reply With Quote
  #3  
Old 18th August 2011, 08:12 PM
ask4nutz Offline
Registered User
 
Join Date: Dec 2009
Location: Philadelphia
Posts: 59
linuxchrome
Re: change bash from terminal

thanks, ox. What I am actually referring to is

Code:
echo "export VAR=/path" >> .bashrc
This will append the variable to the last line of the bash without ever having to open it

cheers
__________________
draft beer, not people
Reply With Quote
  #4  
Old 18th August 2011, 09:04 PM
jpollard Online
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,867
linuxfedorafirefox
Re: change bash from terminal

Blindly appending to the .bashrc makes assumptions about how the .bashrc is interpreted.

A number of them may test for the existence of a terminal, and exit. Thus, they never reach the end of the file.

For simple .bashrc implementations (just a list of assignments), that will work. For others, you need to put it in the right place - for those definitions you want available at all times need to go toward the beginning (before configuration tests of things), and not the end.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Terminal comes up as csh not bash rjames Using Fedora 3 20th April 2011 03:32 PM
[SOLVED] How to Run (not Run in Terminal) bash script with sudo in it? premudriy Using Fedora 2 6th July 2010 06:56 PM
Terminal bash comands unlovedwarrior Using Fedora 6 20th October 2006 08:43 PM
Terminal: bash Berticus Using Fedora 4 24th June 2005 04:45 AM
about terminal and bash Doritos Using Fedora 1 12th January 2005 10:02 PM


Current GMT-time: 12:39 (Saturday, 25-10-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
Khairpur Instagram Photos - Shinas Travel Photos on Instagram - Fribourg Travel Photos