I'm trying to rename some tickets with the rename package, but I'm only getting return code 4 and no other output or errors.
I have already entered some articles, and I am not finding the problem in my expression.
The text pattern is:
companyName-mm.yyyy.pdf
And I would like the pattern
companyName-yyyy.mm.pdf
PS: the companyName has 5 letters
I tried these commands without success:
rename 's/(\w{5})-(\d{2}).(\d{4}).*/' 's/$1-$3\.$2\.pdf/' *.pdf
rename 's/(\w{5})-(\d{2}).(\d{4}).*/$1-$3\.$2\.pdf/' *.pdf
Nothing was renamed and all I got is return code 4.
Could someone tell me what I'm doing wrong?
Edited by @zdim: I lightly edited with clarifications given in a comment by OP