~arivigo/phrenamer

a11091023380cb6a41b3ecfc30847c32c38a446a — Ariadna Vigo 3 months ago 19480fc master
Using dirname instead of substring!
1 files changed, 2 insertions(+), 1 deletions(-)

M phrenamer
M phrenamer => phrenamer +2 -1
@@ 31,7 31,8 @@ IFS="
count=0
for fname in $files; do
	count=$((count + 1))
	newname=$(printf "%s/%0${zeroes}d.jpg" "${fname%/*}" "$count")
	dirpart=$(dirname "$fname")
	newname=$(printf "%s/%0${zeroes}d.jpg" "$dirpart" "$count")
	echo "$fname -> $newname"
	! [ -f "$newname" ] && [ -z "$dry" ] && mv "$fname" "$newname"
done