Your version above has at least two bugs I see (will fall over with various forms of white space in the filenames).  And it would be nice to have interactivity and verboseness (admittedly just flags to mv).  It would also be better to work with plain portable shell, rather than requiring bash, so you&#x27;ll need to include some basename calls.  Also should it stop on the first rename failure, or just keep ploughing on no matter what?<p>Before you know it, you have a script you&#x27;ve debugged and tested.