title: Why is my `.bashrc` run when switching to bash but not sh from a csh launched from Jenkins?
body: <p>I am currently set-up Jenkins to checkout and run a compile, link and execute script from my project (say x script). The script uses a bunch of environment variables to execute. Our default shell is csh and above script is also in c shell. </p>
  
  <p>So far it is good. Now, I have created a Jenkins build job and I have added #!/bin/csh so that another shell can call and execute the script. Jenkins by default uses sh shell to run the commands. So, how do I ensure that all the environment variables available in my c shell are visible under sh shell?
  This is the simplest option for me ...</p>
  
  <p>Option 2 - I can create a sh start-up script so that when Jenkins starts, it can get these environment variables defined automatically. So, to test this, I created 2 files under my home directory -- .profile and .bash_profile</p>
  
  <p>When I switch from c shell to bourne shell by typing sh, none of the start up scripts are getting executed. However, this is true only for sh shell. For bash shell, .bashrc contents are getting executed.</p>
  
  <p>Sample code below:</p>
  
  <p>.bash_profile</p>
  
  <pre><code>echo "hello shrc"
  
  # Source global definitions
  if [ -f /etc/bashrc ]; then
          . /etc/bashrc
  fi
  # User specific aliases and functions
  </code></pre>
  
  <p>.profile</p>
  
  <pre><code>echo "hello shrc"
  .bashrc
  </code></pre>
  
  <p>Commands results below:</p>
  
  <pre><code>sharanb@clnx1 /u25/sharanb -&gt;sh
  sh-4.1$
  </code></pre>
  
  <p>Note nothing gets echoed above</p>
  
  <pre><code>sharanb@clnx1 /u25/sharanb -&gt;bash
  hello bashrc
  [sharanb@clnx1 ~]$
  </code></pre>
  
  <p>Note how .bashrc gets executed.</p>
  
  <p>Need help and guidance </p>