Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
AsthmaBoy
· 2y ago · 0 comments
Wouldn't
readlink -f $0
work to get the actual location of the script, and from there get the base for relative scripts?
Comments
[–]
Asooka
2y ago
The -f flag is a GNU extension. Using realpath is more portable.