From 2f994963899ca8e039dd0aa38884693a9928e116 Mon Sep 17 00:00:00 2001 From: Timo Weingärtner Date: Tue, 11 Oct 2016 14:25:39 +0200 Subject: afssh: use realpath instead of readlink -f, with fallback this add compatibility for some BSD systems which don't have -f to readlink while retaining compatibility with GNU systems without a readlink command Thanks: Konstantinos Koukopoulos --- afssh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/afssh b/afssh index c482aea..3899fba 100755 --- a/afssh +++ b/afssh @@ -51,8 +51,10 @@ fi declare -a agent_filter_args +type realpath >/dev/null 2>&1 || realpath () { readlink -f "$@"; } + if [ -x "${BASH_SOURCE%/*}/ssh-agent-filter" ]; then - SAF=$(readlink -f "${BASH_SOURCE%/*}/ssh-agent-filter") + SAF=$(realpath "${BASH_SOURCE%/*}/ssh-agent-filter") else SAF=$(which ssh-agent-filter) fi -- cgit v1.2.3