Last active
January 24, 2016 06:18
-
-
Save beepony/b525598d0006b6e6dc58 to your computer and use it in GitHub Desktop.
批量重命名的 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
#! /usr/bin/ruby -w | |
# coding:utf-8 | |
require 'fileutils' | |
Dir.glob('./*.txt').each do |f| | |
FileUtils.mv f, "#{File.basename(f,'.*')}.md" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment