Hacker News new | past | comments | ask | show | jobs | submit login

Why wouldn't I rewrite the script to avoid the cd instead? The point of `set -e` isn't to insert all those pointless guards, it's to point out "hey this might fail, so think of a way to do this that doesn't rely on cd".

For your extremely thin example, if it (say) removed some files, I would only remove the files from the current directory or an absolute path.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: