title: Displaying a custom message when cd'ing into a directory
body: <p>I'm looking for a way to display a custom message when cd'ing into a directory. For example</p>
  
  <pre><code>$ cd some_folder
  Warning: Don't edit these files!
  some_folder $
  </code></pre>
  
  <p>From an old post I found the suggestion of adding this to my .bashrc file:</p>
  
  <pre><code>reminder_cd() {
    builtin cd "$@" &amp;&amp; { [ ! -f .cd-reminder ] || cat .cd-reminder 1&gt;&amp;2; }
  }
  
  alias cd=reminder_cd
  </code></pre>
  
  <p>With this script, if I have a file .reminder_cd in my folder, the contents of that file are displayed when I cd into it.</p>
  
  <p>That works, but it seems to kill other scripts that do things when you cd into a directory. Specifically, it kills the ability for Ruby RVM to use .rvmrc to switch ruby versions when you cd into a directory.</p>
  
  <p>Is there a way to modify the function above (or use an entirely different technique) so that it doesn't wipe out any existing scripts that are used when a folder is entered?</p>