When I change working directory in a script and execute it, the working directory only changes to specified path while in the script. Here is my script:
#!/bin/bash
(this was to make sure if it actually changed directory)
cd /media/hard/drive/partitionX/
pwd
When I execute it, it returns the specified path, but my working directory in terminal doesn't change. How do I change the working directory in my terminal through a script?
source
the script. See this similar question.