使用perl
rename
可以轻松处理适当填充并适用于任意数量的季节和剧集的实现(<100,但可以轻松适应您当前的格式):
$ ls -1 *.avi
My Show - 0301 - Qux.avi
My Show - 101 - Foo.avi
My Show - 102 - Bar.avi
My Show - 1102 - Blah.avi
My Show - 201 - Quux.avi
$ rename -n 's/- (\d+)(\d{2,}) -/sprintf("- S%02dE%02d -", $1, $2)/e' *.avi
My Show - 0301 - Qux.avi renamed as My Show - S03E01 - Qux.avi
My Show - 101 - Foo.avi renamed as My Show - S01E01 - Foo.avi
My Show - 102 - Bar.avi renamed as My Show - S01E02 - Bar.avi
My Show - 1102 - Blah.avi renamed as My Show - S11E02 - Blah.avi
My Show - 201 - Quux.avi renamed as My Show - S02E01 - Quux.avi
我认为homebrew
附带了正确的版本,所以只需通过安装即可
$ brew install rename