Bulk renamer shell script - Programming On Unix

Users browsing this thread: 1 Guest(s)
z3bra
Grey Hair Nixers
This is not something I do quite often to be fair, so I never really made a dedicated script for it. This falls into the "one-shot scripted operation" for me, which is pretty close to what your script is doing actually.

When faced with your problem, I generate a script and run it afterwards like so:

Code:
find . -type f -exec printf 'mv "%s" "%s"\n' {} {} \; | vis - | sh

There's no safety net of course, and I assume that "rename samename samename" will generate errors, but I'll ignore them as the script will do what I want anyway.
The advantage is that you seen the actual script that will be executed, rather than having the "mv" command added afterwards. What You See Is What You Run, hehe !

That is a good use of `cmp` there so kudos for that ! You don't get to use it that often ;)


Messages In This Thread
Bulk renamer shell script - by seninha - 19-04-2020, 12:06 PM
RE: Bulk renamer shell script - by jkl - 20-04-2020, 08:04 AM
RE: Bulk renamer shell script - by seninha - 20-04-2020, 09:26 AM
RE: Bulk renamer shell script - by z3bra - 20-04-2020, 10:21 AM
RE: Bulk renamer shell script - by seninha - 20-04-2020, 10:28 AM
RE: Bulk renamer shell script - by z3bra - 20-04-2020, 03:45 PM
RE: Bulk renamer shell script - by jkl - 20-04-2020, 03:46 PM
RE: Bulk renamer shell script - by seninha - 20-04-2020, 04:11 PM
RE: Bulk renamer shell script - by ckester - 20-04-2020, 05:49 PM