From what I know, if you change dir in a shell script, it will change it only during the execution of the script
. Whenever the script stops, you go back to the directory where the schell script was executed.
So if you want to cd to somewhere and execute commands there, you should:
Hope this helps!