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" )
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

View File

@@ -191,7 +191,7 @@ function ncd() {
return
}
local _current_pwd _iter_d _iter_prev _current_found
_current_pwd=$( basename $( pwd ) )
_current_pwd=$( basename "$( pwd )" )
\cd ..
for _iter_d in *; do
if [ ! -d "$_iter_d" ]; then continue; fi