Cannot use a zero directly after a wildcard

Bug #163702 reported by Andrew Ittner
2
Affects Status Importance Assigned to Milestone
mmv (Ubuntu)
Invalid
Low
Unassigned

Bug Description

Binary package hint: mmv

I need to rename files from x?.txt to x0?.txt (x-zero-anycharacter). But if a zero follows any mmv wildcard in the "to" pattern, the rename fails, as mmv thinks the wildcard is "#10" (ten) instead of "#1" followed by a zero.

Repro:
$ touch x{1,2}.txt
$ mmv -r "??.txt" "#10#2.txt"
??.txt -> #10#2.txt : wildcard #10 does not exist.
Nothing done.

Suggested fixes:

- If there is no #9 wildcard, assume there are no wildcards > 9, and that the zeros should remain in the output.
- Allow escaping for any character in the to pattern.
- Allow different wildcard values (like #a, #b) in the to pattern.

Revision history for this message
Andrew Ittner (andrew-ittner) wrote :

Zeros can be escaped with a backlash, like this:

$ mmv -r "??.txt" "#1\0#2.txt"

The original problem is not a bug, but escape character information should be added to the man page.

This bug report was for Kubuntu 6.06.1.

Daniel T Chen (crimsun)
Changed in mmv:
importance: Undecided → Low
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.