The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-22-2006
fawqati fawqati is offline
Registered User
  
 

Join Date: May 2006
Posts: 10
Angry cd from a Bourne Shell Script - Please Help

Dear Bourne Shell Expert,

I am trying to change the current working directory from within a Bourne Shell script. Simply enough i thought !

As I am sure you are well aware, Inside the script i echo `pwd` and it seems ok, but the shell spawns another shell to execute this and as such, when my script finishes it returns to the directory where i executed it in the first place.

i execute the script from /opt/software and simply want to jump to a given directory.

#!/usr/bin/sh

echo " Now in `pwd` ### /opt/software
cd /opt/skill
echo " Now in `pwd` ### /opt/skill

$PROMPT @ /opt/software > pwd returns /opt/software

but i want it to be /opt/skill !!!!!!

Please accept my mmost profound gratitude for your help support and valuable time in this matter.

Best Regards,

FMA