Bulk renamer shell script - Programming On Unix

Users browsing this thread: 1 Guest(s)
seninha
Long time nixers
(20-04-2020, 10:21 AM)z3bra Wrote: 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

That's basically what my script does, but with more tests.
Basically, I run this one liner as:
Code:
ls | bulkrename
Which does the same thing, but I only have to edit the new filename, not the entire mv command.

I also use bulkrename as a command in my filemanager, lf, so I visually select the files to rename and type `:bulkrename`.

(20-04-2020, 10:21 AM)z3bra Wrote: That is a good use of `cmp` there so kudos for that ! You don't get to use it that often ;)
Yeah, most people don't know cmp and use diff for that cases...


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