From 6530695869fd92bc70338b0362d926677140bdd6 Mon Sep 17 00:00:00 2001 From: Ain <41307858+nero@users.noreply.github.com> Date: Fri, 16 Mar 2018 04:07:09 +0000 Subject: [PATCH] Fix for relative path arguments --- realpath.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/realpath.sh b/realpath.sh index 3f2df82..df2944b 100755 --- a/realpath.sh +++ b/realpath.sh @@ -1,6 +1,11 @@ #!/bin/sh p="${1%/}" -p="${p#/}" + +case "$1" in + /*) p="${1#/}" + r="";; + *) p="${PWD#/}/$1";; +esac r=""