Bug#880732: rename creates random corrupt filenames

gregor herrmann gregoa at debian.org
Sat Nov 4 17:50:12 UTC 2017


On Sat, 04 Nov 2017 16:27:24 +0100, g l wrote:

> Package: rename

> > Bug reproduction
> > 
> > cat >> test1.txt
> > a
> > 
> > cat >> test2.txt
> > b
> > 
> > rename 'y/test/renametest/' ./test*.txt
> > 
> > ls -tr ./*
> > renr1.rxr
> > renr2.rxr

I don't see a bug here at first glance.
tr/// and y/// do the following:

        Transliterates all occurrences of the characters found in the search
        list with the corresponding character in the replacement list.

You tell it to replace t with r, e with e, s with n, and again t with
r, so "test" becomes "renr", as expected, and "txt" becomes "rxr".


I suspect you wanted to use s///, as in

rename 's/test/renametest/' ./test*.txt


Let's try:

% touch test1.txt test2.txt
% ls *.txt
test1.txt  test2.txt

% rename 's/test/renametest/' test*.txt

% ls *.txt                               
renametest1.txt  renametest2.txt



Cheers,
gregor

-- 
 .''`.  https://info.comodo.priv.at/ - Debian Developer https://www.debian.org
 : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D  85FA BB3A 6801 8649 AA06
 `. `'  Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
   `-   NP: Wir sind Helden: Kaputt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: Digital Signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20171104/1b395a3c/attachment-0001.sig>


More information about the pkg-perl-maintainers mailing list