<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On Jul 15, 2005, at 5:30 AM, Ed Cogburn wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Russell Cook wrote:</DIV><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">On Fri, 2005-07-15 at 07:22 +0200, Dennis Kaarsemaker wrote:</DIV><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">On vr, 2005-07-15 at 01:05 -0400, Matthew S-H wrote:</DIV><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">What is the difference?<SPAN class="Apple-converted-space">  </SPAN>Under what situations does it read one over</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">the other?</DIV></BLOCKQUOTE><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">.bash_profile is sourced for login shells (where you need to enter a</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">password) and .bashrc for the rest. So .bash_profile should contain</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">thing only to be done once per session and .bashrc should contain things</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">to be done for every terminal you open.</DIV></BLOCKQUOTE><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Hi Dennis,</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">that makes sense, but for noobies, how do we tell what needs to be run</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">for ever terminal. For instance the path extension statement I was</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">looking at. Is the path global for that login, or only that shell?</DIV></BLOCKQUOTE><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">If you're lazy, and don't want to waste time trying to figure this all out</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">(its because of maintaining backwards compatibility with 30+ years of</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Bourne shells that "this" has gotten so complicated - given the speed of</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">machines today there is no reason to maintain this distinction we still</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">have), and don't care if your machine wastes a few cycles and a small</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">fraction of a second when starting up (how big a fraction depends on what</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">stuff you're doing at startup of a shell), just run the same thing for</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">both.<SPAN class="Apple-converted-space">  </SPAN>:)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Have ".bash_profile" (also known as ".bash_login") for login shells, and</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">".bashrc" for all other shells just source the same file, like say</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">".bash_startup", and have the 2 previous files just have "source</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">~/.bash_startup" as the only line in them.<SPAN class="Apple-converted-space">  </SPAN>Then put whatever settings you</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">need in that one file, and "forget" about the other two.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">There are variations on this, whatever suits your preferences.<SPAN class="Apple-converted-space">  </SPAN>I have a</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">single file in /etc/ that is sourced by both of those files above.<SPAN class="Apple-converted-space">  </SPAN>Others</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">put most of their settings in .bashrc, and have the login shell source that</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">as the last command in its .bash_login, etc. etc.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">About the only thing that really makes sense being in one of .bash_login</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">or .bash_profile, but not in .bashrc are commands that affect the display</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">of the command line prompt.<SPAN class="Apple-converted-space">  </SPAN>However, if you're using midnight commander,</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">it unfortunately uses a non-login shell for the shell line it shows at the</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">bottom, even though its used just like a login shell, so for that reason</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">and for laziness, I just have both "types" of shells set themselves up</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">exactly the same way.<SPAN class="Apple-converted-space">  </SPAN>Seems to work fine, haven't seen any smoke coming</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">from the case yet...<SPAN class="Apple-converted-space">  </SPAN>:)</DIV></BLOCKQUOTE><BR></DIV><DIV>Just an alternative that I am doing now that simplifies things even more:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>sudo ln -s /etc/bash_profile /etc/bashrc</DIV><DIV>ln -s ~/.bash_profile ~/.bashrc</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>That simplifies things even more, I think.</DIV><DIV>Now, you don't even have to remember which is the original.</DIV><DIV>Also, if you wan't, you could make hard links instead of symbolic links by removing the "-s" option.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>If I am wrong about this working, I'd appreciate it if someone would tell me before I F--K my system up.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>~Matt</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><FONT class="Apple-style-span" color="#0000DD"></FONT></BODY></HTML>