Created
June 7, 2014 05:38
-
-
Save hyuki0000/2c27e9f6c83bace69cad to your computer and use it in GitHub Desktop.
31foo.eps → 10foo.eps のようにファイル名変換するシェルスクリプトを生成するRubyスクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 31foo.eps → 10foo.eps | |
# 35baa.eps → 30baa.eps | |
# のようにファイル名変換するシェルスクリプトを生成するRubyスクリプト | |
MAP = { | |
'31' => '10', | |
'32' => '10', | |
'33' => '20', | |
'34' => '20', | |
'35' => '30', | |
'36' => '30', | |
'37' => '40', | |
'38' => '40', | |
'39' => '50', | |
'40' => '50', | |
} | |
Dir.glob("*.eps") do |eps| | |
if eps.match(/(\d\d)(.*.eps)/) | |
puts "mv -i #{$1}#{$2} #{MAP[$1]}#{$2}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment