fix ncd, mvregex should get a total facelift

This commit is contained in:
ville rantanen
2018-05-20 13:33:31 +03:00
parent 28f45f382b
commit 3405f45501
2 changed files with 5 additions and 2 deletions

View File

@@ -109,7 +109,10 @@ if [ "$MODE" = "printf" ]; then
# remove zeroes from beginning, if matching integers
let source_match="10#$source_match" &> /dev/null
target_replace=$( printf "$TGT" "$source_match" )
mv -iv -- "$file" "$( echo $file | sed s/"$SRC"/"${target_replace}"/ )"
target_file="$( echo $file | sed s/"$SRC"/"${target_replace}"/ )"
if [[ ! "$file" = "$target_file" ]]; then
mv -iv -- "$file" "$( echo $file | sed s/"$SRC"/"${target_replace}"/ )"
fi
done
exit
fi