ambevar-dotfiles/.local/bin/realpath

14 lines
385 B
Plaintext
Raw Normal View History

2013-08-26 14:09:56 +02:00
#!/bin/sh
2014-01-21 14:00:31 +01:00
## This is a compatibility wrapper for 'realpath'. This script is not seen if
## the parent folder is after /usr/{local/}bin in PATH.
2013-08-26 14:09:56 +02:00
if command -v greadlink >/dev/null 2>&1; then
2016-10-12 09:43:43 +02:00
## On BSD systems, we might have greadlink
greadlink -f "$@"
elif command -v readlink >/dev/null 2>&1 && [ "$(uname)" = "Linux" ]; then
2016-10-12 09:43:43 +02:00
readlink -f "$@"
2013-08-26 14:09:56 +02:00
else
2016-10-12 09:43:43 +02:00
## Dirty fallback
echo "$@"
fi