Invoke readlink -f in a way which can succeed

This commit is contained in:
Tom "Ravi" Hale
2018-08-30 18:42:41 +07:00
parent 5a8c2fec12
commit 0b5a29bbd6

View File

@@ -100,10 +100,10 @@ if ! ls --color=auto > /dev/null 2>&1; then
fi fi
# Test if readlink supports -f option, otherwise use perl (a bit slower) # Test if readlink supports -f option, otherwise use perl (a bit slower)
if ! readlink -f > /dev/null 2>&1; then if ! readlink -f / > /dev/null 2>&1; then
_abs_path_command='perl -e "use Cwd "abs_path"; print abs_path(shift)"' _abs_path_command=(perl -e 'use Cwd abs_path; print abs_path(shift)')
else else
_abs_path_command="readlink -f" _abs_path_command=(readlink -f)
fi fi
# Function wrapper around 'll' # Function wrapper around 'll'