OK, thank you, that worked. I also see the wisdom of using your program as it reorders from start to finish, thanks for pointing that out. I'm very new to any programming so I started with the easiest to read. I have a question about reading your code:
count=$(( $count + 1 ))
I understand increments and saves count...then:
count0="000$count"
What's here, count0 is assigned 0001?
renumbered="${count0: -3}_${file#???_}"
THEN, get a little mixed up. Takes file number whatever say 256_ (puts in $)....then count0 (or 0001): -3 ...this lost me
so what is ${count0: -3} saying exactly?
[[ "$file" != "$renumbered" ]] && echo mv -v "$file" "$renumbered"
I think I understand this: (& finally pop out the echo when test succeeds)
OK, other than my lack of coding knowledge I think you found the best solution to my issue.
Thanks again.
Bookmarks