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 # remove zeroes from beginning, if matching integers
let source_match="10#$source_match" &> /dev/null let source_match="10#$source_match" &> /dev/null
target_replace=$( printf "$TGT" "$source_match" ) 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 done
exit exit
fi fi

View File

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