Skip to content

Instantly share code, notes, and snippets.

@beepony
Last active January 24, 2016 06:18
Show Gist options
  • Save beepony/b525598d0006b6e6dc58 to your computer and use it in GitHub Desktop.
Save beepony/b525598d0006b6e6dc58 to your computer and use it in GitHub Desktop.
批量重命名的 Ruby 脚本
#! /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