ambevar-dotfiles/.scripts/realpath

12 lines
308 B
Bash
Executable File

#!/bin/sh
## This is a compatibility wrapper for 'realpath'.
if [ -n "$(command -v greadlink)" ]; then
## On BSD systems, we might have greadlink
greadlink -f "$@"
elif [ -n "$(command -v readlink)" ] && [ "$(uname)" = "Linux" ]; then
readlink -f "$@"
else
## Dirty fallback
echo "$@"
fi