LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-23-2002, 06:57 PM   #1
ChimpFace9000
Member
 
Registered: Jul 2001
Location: So. Cal.
Distribution: Slackware 8.1
Posts: 55

Rep: Reputation: 15
Post bash files


Should i use .bash_profile or .bashrc to put bash initialization stuff in? It seems that .bash_profile is used when you first login, and .bashrc is used every other time (like in xterm for example). Is it supposed to be like this?
 
Old 08-23-2002, 09:24 PM   #2
mlp68
Member
 
Registered: Jun 2002
Location: NY
Distribution: Gentoo,RH
Posts: 333

Rep: Reputation: 40
There is a similar thread at

http://www.linuxquestions.org/questi...threadid=27095

where I posted some stuff - what makes the difference is whether or not your shell is a login shell. That used to have a well-defined meaning in the days of terminals; you logged in and that was the login shell. With Xwindows, that is more fuzzy -- xterm -ls gives you a login shell, for example.

But there is a reason behind this. Since .bash_profile is executed (in principle) only once, that is the place where you can append to the system-preset path, for example. If you did that in .bashrc, your path would grow with each level of shell invocation. You would set the prompt, alias definitions, in general define stuff that is not inherited by a subshell.

mlp
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash help renaming files kahn Programming 6 06-16-2005 07:15 AM
bash: cp files and sed nachtfalter Programming 3 10-04-2004 07:06 PM
making .tif files into animated .gif files (bash shell, Red Hat 7.2) illiniguy3043 Linux - Newbie 1 06-01-2004 04:04 PM
missing bash files KptnKrill Linux - Newbie 2 08-06-2003 02:45 PM
Missing Bash Files krymsunmortis Slackware 3 01-12-2003 07:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:18 PM.

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
Open Source Consulting | Domain Registration