diff options
author | Timo Weingärtner <timo@tiwe.de> | 2016-10-11 14:25:39 +0200 |
---|---|---|
committer | Timo Weingärtner <timo@tiwe.de> | 2016-10-11 14:25:39 +0200 |
commit | 2f994963899ca8e039dd0aa38884693a9928e116 (patch) | |
tree | 1a82f28bde90ee1a56b7b73f3d739592cceb1911 | |
parent | f8e42e89e3404f91d397e325c94af6494786e90f (diff) | |
download | ssh-agent-filter-2f994963899ca8e039dd0aa38884693a9928e116.tar.gz |
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 <kouk@transifex.com>
-rwxr-xr-x | afssh | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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 |