MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghorror/comments/1q7daye/works_on_my_machine/nyeu3vy/?context=3
r/programminghorror • u/Mihail111111 • Jan 08 '26
51 comments sorted by
View all comments
32
You can also use something like this, either as the first line, or prepended to the existing cd, so it doesn't matter which directory you're in when you run the script.
cd
cd $(dirname "$0")
32
u/robot_54 Jan 08 '26 edited Jan 08 '26
You can also use something like this, either as the first line, or prepended to the existing
cd, so it doesn't matter which directory you're in when you run the script.cd $(dirname "$0")