This is the mail archive of the
mailing list for the Cygwin project.
cygwin rename util doesn't parse leading dash in expression argument correctly (thinks it is an option)
- From: Dat Head <dathead2 at gmail dot com>
- To: The Cygwin Mailing List <cygwin at cygwin dot com>
- Date: Tue, 2 Sep 2014 10:43:15 -0400
- Subject: cygwin rename util doesn't parse leading dash in expression argument correctly (thinks it is an option)
- Authentication-results: sourceware.org; auth=none
$ ls -l *-fixed.flac
-rw-r--r-- 1 foo None 0 Sep 1 13:47 a-fixed.flac
-rw-r--r-- 1 foo None 0 Sep 1 13:47 b-fixed.flac
$ rename '-fixed' '' *-fixed.flac
rename: unknown option -- f
rename [options] expression replacement file...
-v, --verbose explain what is being done
-V, --version output version information and exit
-h, --help display this help and exit
escaping dash with backslash doesn't work either.
this used to work in a MUCH older version of cygwin.
I tried to get a newer version in util-linux to compile but ran into a
lot of troubles. i also saw some notes that some cyg-specific items were
removed from newer util-linux which is why maybe it hasn't been upgraded?
also of note is rename works fine in redhat5/6 because they use util-linux-ng
$ uname -a
CYGWIN_NT-6.1 frog2 1.7.30(0.272/5/3) 2014-05-23 10:36 x86_64 Cygwin
$ rename -V
rename from util-linux 2.21.2
I had to write a cheap sed script to get me by for now but it isn't very
robust, but does what I need it to
"Ethics cannot spring from laws as you think,
Moral is something you feel" - Anders Osborne
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple