Bug#1033405: rename: Switch --nono is sensitive to location
Max Görner
max+reportbug at familie-goerner.eu
Fri Mar 24 14:00:54 GMT 2023
Package: rename
Version: 2.01-1
Severity: important
Dear Maintainer,
I tried to rename a bunch of files using `rename`/`file-rename`. I
checked carefully that both names point to the same program.
Since I wasn't sure about the correctness of renaming rule, I
**appended** the switch `--nono`. So, the final command I executed was
`rename 's/.*(S\d\d)_(E\d\d).*/$1$2$_/' --nono *`. Unfortunately, this
directly renamed all files! If I move `--nono` before the pattern,
everything behaves as expected: `rename --nono 's/.*(S\d\d)_(E\d\d).*/$1$2$_/' *`
The man page does not point out this behaviour as well. According to the
man page, giving `--nono` will stop `file-rename` to apply any changes.
In particular it is not mentioned that `--nono` must be given as first
argument and will have no effect otherwise.
I find this behaviour highly dangerous and it deleted some important
files I need to dig out from my backups now.
I think the preferred fix would be make `--nono` work regardless of its
position. A less favourable improvement could be to explicitly mention
the behaviour in the man page.
Thank you very much.
Regards
Max Görner
-- System Information:
Debian Release: 12.0
APT prefers testing
APT policy: (990, 'testing'), (500, 'testing-security'), (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 6.2.8+ (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE=de:en_GB
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages rename depends on:
ii perl 5.36.0-7
rename recommends no packages.
rename suggests no packages.
-- no debconf information
More information about the pkg-perl-maintainers
mailing list