rename (prename) ignores -n parameter in Xenial Daily
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
rename (Debian) |
Fix Released
|
Unknown
|
|||
rename (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Xenial Daily with updates applied up to 2015-11-24 20:50 GMT
The perl rename function (aka prename) appears to rename files even when the -n parameter is supplied. The -n parameter is supposed to make it display possible changes, but not actually rename files (no action).
Unfortunately in the latest Xenial Daily it ignores the -n and goes ahead and renames the files.
This also applies to the long option --no-act
Example:
touch oldname
rename "s/oldname/
ls
What I expected to happen:
* The command should return "oldname renamed as newname"
* The listing should show the file "oldname"
What actually happens::
* The command returns nothing
* The listing shows the file "newname"
Also note that even without the -n parameter - i.e. when I deliberately *want* to make the change - the command still does not return anything. Normally it would return "oldname renamed as newname".
perl --version shows:
This is perl 5, version 20, subversion 2 (v5.20.2) built for x86_64-
rename -V shows:
/usr/bin/rename using File::Rename version 0.20
I am wondering whether this is some kind of clash between the rename package and the perl package. Xenial seems to be very confused about which version of rename it has installed.
Now try the test case using the exact spelling "prename". The test case now works as expected. In previous LTS versions of Ubuntu, prename and rename were one and the same program.
Try the following:
man rename
man prename
Note the differences in parameters (e.g. --nono vs. --no-act) Both of these commands claim to be Perl rename.
In the the previous LTS version of Ubuntu, 14.04, doing man rename and man prename gave identical results. My test case above worked as expected under 14.04 .
Also note that despite the 16.04 man pages and 14.04 man pages stating that the -n parameter has to be provided *before* the expression and files, under 14.04 (and for as long as I can remember, possibly back to 6.06) it worked fine providing the -n parameter *after* the other arguments.
(I only test LTS releases. This bug may or may not have been extant in 14.10,15.04,15.10 )
Thank-you for your time examining this bug. Having a stable LTS Ubuntu is important to me; genuine thanks.
affects: | usb-creator (Ubuntu) → rename (Ubuntu) |
Changed in rename (Debian): | |
status: | Unknown → Confirmed |
Changed in rename (Debian): | |
status: | Confirmed → Fix Released |
Doing sudo apt-get remove rename seemed to solve this problem.
I am wondering whether I installed rename by mistake. Is it installed by default? If so, it shouldn't be; I believe rename is provided by Perl anyway.