The problem is that rename
uses getopt
for argument parsing and thus has a special interpretation for double dash (--
). --
signifies the end of the arguments.
A solution would be to avoid using --
in your command. One way to do this is to break your command into sub targets, e.g. translate single dash to underscore, then two underscores to single dash:
$ rename - _ *.mkv
$ rename __ - *.mkv
A less roundabout way to do this is to actually use the getopt
behavior
$ rename -- -- - *.mkv