Challenge ET

気になったこと書いてます。English IT

Very nice cli tool for me. Rename multiple files. (day4)

Following tool is nice!! That tool make us a bit happy.

itchyny/mmv: rename multiple files with editor

Until now, I was using my original perl script shown next.
I can replace it all. Thanks.

#!/usr/bin/env perl

use strict;
use warnings;

=head1 DESCRIPTION
Save script with "mv-all"

Usage: 
This command result, showing STDOUT.
$ mv-all aaa bbb 

Execute using next command.
$ mv-all aaa bbb | sh
=cut

my ($before, $after) = @ARGV;
system 'for f in `ls`; do echo "mv $f ${f/'.$before.'/'.$after.'}"; done';