{"id":8192,"date":"2017-03-07T22:03:02","date_gmt":"2017-03-08T05:03:02","guid":{"rendered":"http:\/\/www.codelovecode.com\/blog\/?p=201"},"modified":"2017-04-10T15:44:33","modified_gmt":"2017-04-10T22:44:33","slug":"bash_profile-vs-bashrc","status":"publish","type":"post","link":"https:\/\/www.alannarisse.com\/blog\/bash_profile-vs-bashrc\/","title":{"rendered":"bash_profile vs bashrc"},"content":{"rendered":"<p>I&#8217;ve been spending a great deal of time with BASH lately and I&#8217;m confused about best practices on the mac. I found this helpful article.<\/p>\n<p><a href=\"http:\/\/www.joshstaiger.org\/archives\/2005\/07\/bash_profile_vs.html\">http:\/\/www.joshstaiger.org\/archives\/2005\/07\/bash_profile_vs.html<\/a><\/p>\n<blockquote><p>Why two different files?<\/p>\n<p>Say, you\u2019d like to print some lengthy diagnostic information about your machine each time you login (load average, memory usage, current users, etc). You only want to see it on login, so you only want to place this in your .bash_profile. If you put it in your .bashrc, you\u2019d see it every time you open a new terminal window.<\/p><\/blockquote>\n<p>Another thing to keep in mind is that MAC OSX keeps it&#8217;s .bashrc file (located at ~\/.bashrc on linux\/unix) in a file located at \/etc\/bashrc<\/p>\n<p>Using <code>source .bashrc<\/code> or <code>source .bash_profile<\/code> will switch back and forth<\/p>\n<p>This post has a nice table of escaped special characters you can use in your prompt.\u00a0<a href=\"https:\/\/www.cyberciti.biz\/tips\/howto-linux-unix-bash-shell-setup-prompt.html\">https:\/\/www.cyberciti.biz\/tips\/howto-linux-unix-bash-shell-setup-prompt.html<\/a><\/p>\n<p>Also helpful is the sequence in which MacOSX and unix look for bash setup files and how to set up an if statement http:\/\/apple.stackexchange.com\/questions\/119711\/why-doesnt-mac-os-x-source-bashrc<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been spending a great deal of time with BASH lately and I&#8217;m confused about best practices on the mac. I found this helpful article. http:\/\/www.joshstaiger.org\/archives\/2005\/07\/bash_profile_vs.html Why two different files? Say, you\u2019d like to print some lengthy diagnostic information about your machine each time you login (load average, memory usage, current users, etc). You only [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-8192","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.alannarisse.com\/blog\/wp-json\/wp\/v2\/posts\/8192","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.alannarisse.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.alannarisse.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.alannarisse.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.alannarisse.com\/blog\/wp-json\/wp\/v2\/comments?post=8192"}],"version-history":[{"count":3,"href":"https:\/\/www.alannarisse.com\/blog\/wp-json\/wp\/v2\/posts\/8192\/revisions"}],"predecessor-version":[{"id":8258,"href":"https:\/\/www.alannarisse.com\/blog\/wp-json\/wp\/v2\/posts\/8192\/revisions\/8258"}],"wp:attachment":[{"href":"https:\/\/www.alannarisse.com\/blog\/wp-json\/wp\/v2\/media?parent=8192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.alannarisse.com\/blog\/wp-json\/wp\/v2\/categories?post=8192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.alannarisse.com\/blog\/wp-json\/wp\/v2\/tags?post=8192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}