Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've been using

script_dir="$(dirname "$(realpath "$0")")"

Hasn't failed me so far and it's easy enough to remember



Read the answers and comments from the SO threads. It won't always work for other people in other context.




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

Search: