[Bug 717608] New: rename do not work as expected
https://bugzilla.novell.com/show_bug.cgi?id=717608 https://bugzilla.novell.com/show_bug.cgi?id=717608#c0 Summary: rename do not work as expected Classification: openSUSE Product: openSUSE 12.1 Version: Factory Platform: Other OS/Version: SuSE Other Status: NEW Severity: Minor Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: jdd@dodin.org QAContact: qa@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; Linux i686; rv:6.0.2) Gecko/20100101 Firefox/6.0.2 on 11.4, the script: for I in *.jpg ; do rename ".jpg" "-$RANDOM.jpg" $I ; done works perfectly, adding a -random number before the "." of my photos on 12.1 (beta for now, I beleive), rename see the "-" as the beginning of an option. There is an easy workaround, when you understand that, it's adding "--" after rename. It may be a feature, but it breaks scripts and I spent several hours to find why I see no reason to have this, as the three rename parameters are mandatory, so if there are options, they have to be the 4th one, easy to detect Reproducible: Always Steps to Reproduce: 1. 2. 3. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=717608 https://bugzilla.novell.com/show_bug.cgi?id=717608#c1 --- Comment #1 from Jean-Daniel Dodin <jdd@dodin.org> 2011-09-13 19:12:40 UTC --- the working line is: rename -- ".jpg" "-$RANDOM.jpg" $I ; -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=717608 https://bugzilla.novell.com/show_bug.cgi?id=717608#c2 Karl Eichwalder <ke@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ke@suse.com --- Comment #2 from Karl Eichwalder <ke@suse.com> 2011-09-14 01:57:15 CEST --- Such a change is fine for a new major release, especially because it is the usual GNU behavior. All we shall do, is mention this change in hte release notes, I think. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=717608 https://bugzilla.novell.com/show_bug.cgi?id=717608#c3 --- Comment #3 from Jean-Daniel Dodin <jdd@dodin.org> 2011-09-14 09:27:22 UTC --- yes. Simply giving an example in the man page would be nice. thanks jdd -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=717608 https://bugzilla.novell.com/show_bug.cgi?id=717608#c4 Andreas Jaeger <aj@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team-screening@forge.pr |ke@suse.com |ovo.novell.com | --- Comment #4 from Andreas Jaeger <aj@suse.com> 2011-10-19 07:35:20 UTC --- Karl, will you add something to the release notes? Otherwise I consider this not a bug. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=717608 https://bugzilla.novell.com/show_bug.cgi?id=717608#c5 Karl Eichwalder <ke@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Component|Other |Release Notes Summary|rename do not work as |RN: rename do not work as |expected |expected QAContact|qa@suse.de |coolo@suse.com --- Comment #5 from Karl Eichwalder <ke@suse.com> 2011-10-19 09:58:17 CEST --- <title>The rename Command</title> <para> According to the GNU Coding Standards, the rename command now treats all strings beginning with a dash as a command line option. To prevent this, separate the option from the other arguments with <literal>--</literal> as follows: </para> <screen> for f in *.jpg ; do rename -- ".jpg" "-$RANDOM.jpg" $f ; done </screen> -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=717608 https://bugzilla.novell.com/show_bug.cgi?id=717608#c6 --- Comment #6 from Jean-Daniel Dodin <jdd@dodin.org> 2011-10-19 11:15:58 UTC --- that's perfect. Was it already in the man page? If so I have to apologize... not having seen it! anyway thanks jdd -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=717608 https://bugzilla.novell.com/show_bug.cgi?id=717608#c7 --- Comment #7 from Karl Eichwalder <ke@suse.com> 2011-10-19 14:06:17 CEST --- (In reply to comment #6)
that's perfect. Was it already in the man page? If so I have to apologize... not having seen it!
No ;) This is what I intend to put into the release notes for 12.1. If we want to see it in the rename man page, we must probably create a separate bug entry or clone this one and assign it the the util-linux package maintainer. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=717608 https://bugzilla.novell.com/show_bug.cgi?id=717608#c8 --- Comment #8 from Jean-Daniel Dodin <jdd@dodin.org> 2011-10-19 12:47:50 UTC --- it's very good, and should be in the man page as it's a change from previous syntax :-) thanks jdd -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=717608 https://bugzilla.novell.com/show_bug.cgi?id=717608#c9 Karl Eichwalder <ke@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED Summary|RN: rename do not work as |RN: rename does not work as |expected |expected --- Comment #9 from Karl Eichwalder <ke@suse.com> 2011-10-21 09:35:09 CEST --- Submitted to the build. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com