diff --git a/move.sh b/move.sh index eee4ede..47d5575 100644 --- a/move.sh +++ b/move.sh @@ -43,7 +43,7 @@ if [ $algebraic_notation -eq 0 ] then origin=$(echo $move | awk -F\- '{print $1}') dest=$(echo $move | awk -F\- '{print $2}') - if grep $origin $file > /dev/null + if grep $dest $file > /dev/null then if [ $force -eq 1 ] then @@ -51,10 +51,10 @@ then mv $file.new $file else sed 's/'"$dest"'/0,0/g' $file > $file.new - mv $file.new $file + sed 's/'"$origin"'/'"$dest"'/' $file.new > $file fi else - echo moving sed 's/'"$origin"'/'"$dest"'/' $file > $file.new + mv $file.new $file fi fi