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(-) (limited to 'afssh') 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 From 3944f8c3b52e23e7e617fbfa24307ce8c07757e6 Mon Sep 17 00:00:00 2001 From: Timo Weingärtner Date: Tue, 11 Oct 2016 16:42:02 +0200 Subject: fixup! afssh: use realpath instead of readlink -f, with fallback --- afssh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'afssh') diff --git a/afssh b/afssh index 3899fba..3c715e3 100755 --- a/afssh +++ b/afssh @@ -51,9 +51,8 @@ fi declare -a agent_filter_args -type realpath >/dev/null 2>&1 || realpath () { readlink -f "$@"; } - if [ -x "${BASH_SOURCE%/*}/ssh-agent-filter" ]; then + type realpath >/dev/null 2>&1 || realpath () { readlink -f "$@"; } SAF=$(realpath "${BASH_SOURCE%/*}/ssh-agent-filter") else SAF=$(which ssh-agent-filter) -- cgit v1.2.3