title: implementing cd command using chdir() in linux
body: <p>I am writing my own shell program. I am currently implementing the cd command using chdir.
  I want to implement the chdir with the below options : </p>
  
  <p>-P Do not follow symbolic links<br>
  -L Follow symbolic links (default)</p>
  
  <p>I posted a <a href="https://stackoverflow.com/questions/3032897/how-to-check-if-a-path-is-actual-or-symbolic-link">question here previously asking to know if a path is a symbolic link or actual path</a>. But with that info I am unable to get any ideas on how to proceed with the above problem.</p>
  
  <p>Thanks</p>