Posted By

loungerdork on 07/07/09


Tagged

path script


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

deepsoul


Find absolute path of Bash script


 / Published in: Bash
 

Gets the absolute path of the script itself even when it's executing, not just a simple "pwd".

  1. abspath="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")"

Report this snippet  

You need to login to post a comment.