Use the realpath instead of the provided filename.
authorFrancois Fleuret <francois@fleuret.org>
Sat, 17 Jun 2017 10:48:33 +0000 (12:48 +0200)
committerFrancois Fleuret <francois@fleuret.org>
Sat, 17 Jun 2017 10:48:33 +0000 (12:48 +0200)
freeze-dir.sh

index 14c3070..375db4b 100755 (executable)
@@ -32,9 +32,9 @@ if [[ ! -d ${FREEZE_DIR} ]]; then
 fi
 
 while [[ "$1" ]]; do
-
-    dir=$(basename "$1")
-    path=$(dirname "$1")
+    real_path=$(realpath "$1")
+    dir=$(basename "${real_path}")
+    path=$(dirname "${real_path}")
     full_path="${path}/${dir}"
 
     date=$(date +%Y_%b_%d_%H:%M:%S)