#70186 closed defect (fixed)
util-linux @2.40.1: `rename` doesn't preserve original file name parts
Reported by: | Bachsau (Bachsau) | Owned by: | kurthindenburg (Kurt Hindenburg) |
---|---|---|---|
Priority: | High | Milestone: | |
Component: | ports | Version: | 2.9.3 |
Keywords: | Cc: | ryandesign (Ryan Carsten Schmidt) | |
Port: | util-linux |
Description
I've been running the following command and instead of replacing the file extension, it wants to rename every file to the exact string specified as the replacement:
find . -type f -iname '*.pdf' -exec rename -v -n pdf pdf_ {} +
Running the same command in the same directory from a linux machine works as expected.
For example, it does this:
'./2020/2020-01.pdf' -> `pdf_'
instead of this:
'./2020/2020-01.pdf' -> `./2020/2020-01.pdf_'
Change History (4)
comment:1 Changed 5 months ago by Bachsau (Bachsau)
comment:2 Changed 5 months ago by ryandesign (Ryan Carsten Schmidt)
Owner: | set to kurthindenburg |
---|---|
Status: | new → assigned |
Summary: | `rename` doesn't preserve original file name parts → util-linux @2.40.1: `rename` doesn't preserve original file name parts |
The selectable version in the issue template is the MacPorts version, not the port version (which goes in the summary along with the port name).
Just to make sure, I tried an example from the rename
manpage:
rename .htm .html *.htmwill fix the extension of your html files.
% port -v installed util-linux The following ports are currently installed: util-linux @2.40.1_0 (active) requested_variants='' platform='darwin 21' archs='x86_64' date='2024-05-15T02:37:30-0500' % mkdir test % cd test % touch foo.htm bar.htm % ls -la total 0 drwxr-xr-x 4 rschmidt wheel 128 Jun 7 14:39 . drwxrwxrwt 42 root wheel 1344 Jun 7 14:38 .. -rw-r--r-- 1 rschmidt wheel 0 Jun 7 14:39 bar.htm -rw-r--r-- 1 rschmidt wheel 0 Jun 7 14:39 foo.htm % rename -v .htm .html *.htm `bar.htm' -> `.html' `foo.htm' -> `.html' % ls -la total 0 drwxr-xr-x 3 rschmidt wheel 96 Jun 7 14:39 . drwxrwxrwt 42 root wheel 1344 Jun 7 14:38 .. -rw-r--r-- 1 rschmidt wheel 0 Jun 7 14:39 .html %
Here is the upstream issue: https://github.com/util-linux/util-linux/issues/3071
comment:3 Changed 4 months ago by ryandesign (Ryan Carsten Schmidt)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:4 Changed 4 months ago by ryandesign (Ryan Carsten Schmidt)
Cc: | ryandesign added |
---|
Note: See
TracTickets for help on using
tickets.
It actually is version 2.40.1, but that isn't selectable.