On Fri, 15 Nov 2019 at 12:51, Piers via luv-main <[email protected]> wrote:
>
> Hi there,

Hi

> I have a bunch of files that I want to rename:

For a range of approaches, have a look here:
http://mywiki.wooledge.org/BashFAQ/030

> ...sorry regex is a shortfall of mine.

There's no regex anywhere in your examples, only
"globs" aka shell pattern matching aka shell pathname
expansion. See here:
http://mywiki.wooledge.org/glob
http://mywiki.wooledge.org/RegularExpression

It's important to understand that these are distinct things.
They superficially might look similar, but they behave
differently. regex is more powerful, and more complicated.

A perl-based solution will require you to use regex notation.

A solution using 'find' and 'mv' with shell parameter expansion
(like your example)
http://mywiki.wooledge.org/BashFAQ/073
will require you to use glob notation.

So a first step might be to choose which of regex or glob you
prefer, and then proceed from there. Your problem statement
looks simple enough that regex is not required, unless you
choose an approach that mandates using regex.

Personally being already comfortable with both, I would
probably use a perl-based "rename" tool. It has a dry-run
option which is useful when you are unsure of the syntax.
_______________________________________________
luv-main mailing list
[email protected]
https://lists.luv.asn.au/cgi-bin/mailman/listinfo/luv-main

Reply via email to