title: Unable to change directory in Shell Script running on Jenkins
body: <p>I am trying to run a shell script on Jenkins and want to change the directory. My code is as follows :</p>
  
  <pre><code>#!/bin/bash
  pwd
  function myprog() {
   cd root/data
  }
  
  myprog
  pwd
  </code></pre>
  
  <p>I tried all possibilities mentioned in the question posted <a href="https://askubuntu.com/questions/481715/why-doesnt-cd-work-in-a-shell-script">here</a>.</p>
  
  <p>I tried symbolic links, Alias and function, however no success. In the jenkins console output i always get the following error :</p>
  
  <pre><code>/tmp/hudson772738020072372550.sh: line 11: cd: root/data: No such file or directory
  </code></pre>
  
  <p>What i notice here is that, there is a colon after cd, is that creating some issue? Kindly help. Thanks.</p>