From 366f528621e7d577106aa71c162f1c7d1472d7db Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 29 May 2014 15:27:38 -0300 Subject: More mvln fixes --- mvln | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mvln') diff --git a/mvln b/mvln index b79feab..ec4c359 100755 --- a/mvln +++ b/mvln @@ -8,16 +8,16 @@ # http://serverfault.com/questions/8108/move-a-file-and-leave-a-soft-link-behind # Parameters -ORIG="$1" -DEST="$2" BASE="$(basename "$1")" +ORIG="$(dirname "$1")" +DEST="$2" # Check -if [ ! -e "$1" ]; then - echo "File not found: $1" +if [ ! -e "$ORIG/$BASE" ]; then + echo "File not found: $ORIG/$BASE" exit 1 fi # Proceed mkdir -p "$DEST" -mv "$ORIG" "$DEST" && ln -s "$DEST/$BASE" "$ORIG" +mv "$ORIG/$BASE" "$DEST" && ln -s "$DEST/$BASE" "$ORIG/$BASE" -- cgit v1.2.3