The cd is done within the script's shell. When the script ends, that shell exits, and then you are left in the directory you were. So you run script . yourscript.sh by adding ..
Reference: http://stackoverflow.com/a/2236614/1146834
The cd is done within the script's shell. When the script ends, that shell exits, and then you are left in the directory you were. So you run script . yourscript.sh by adding ..
Reference: http://stackoverflow.com/a/2236614/1146834