4 ms·
For canonicalizing directories, you can use this portably: dir=$(cd -P -- "$dir" && pwd) with the usual gotcha that $() strips trailing newlines.
by jwilk 5y ago
For canonicalizing directories, you can use this portably:
dir=$(cd -P -- "$dir" && pwd)
with the usual gotcha that $() strips trailing newlines.