From: Nicolas Boisselier Date: Mon, 11 Mar 2019 05:29:03 +0000 (+0000) Subject: etc/profile.d/functions X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=39702892e4de6d04c3266da51988f467a2a33bdf;p=nb.git etc/profile.d/functions --- 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() {