Hacker News new | ask | show | jobs
by AsthmaBoy 925 days ago
Wouldn't

  readlink -f $0
work to get the actual location of the script, and from there get the base for relative scripts?
1 comments

The -f flag is a GNU extension. Using realpath is more portable.