From 39702892e4de6d04c3266da51988f467a2a33bdf Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Mon, 11 Mar 2019 05:29:03 +0000 Subject: [PATCH] etc/profile.d/functions --- etc/profile.d/functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/etc/profile.d/functions b/etc/profile.d/functions index ec5fdca6..82c05f49 100755 --- a/etc/profile.d/functions +++ b/etc/profile.d/functions @@ -22,11 +22,12 @@ which timeout > /dev/null || timeout() { } which realpath > /dev/null || realpath() { + perl -MFile::Spec -MCwd -e 'print File::Spec->rel2abs( Cwd::abs_path($ARGV[0]) )."\n" if -e $ARGV[0]' "$1" + return case "$OSTYPE" in darwin*) [ -h "$1" ] && readlink "$1" || echo "$1";; *) readlink -f "$1" ;; esac - # perl -MFile::Spec -MCwd -e 'print File::Spec->rel2abs( Cwd::abs_path($ARGV[0]) )."\n" if -e $ARGV[0]' "$1" } # NB 11.03.19 which realpath > /dev/null || realpath() { -- 2.47.3