Created
February 9, 2015 04:52
-
-
Save tani/85fafc1b754a2c486845 to your computer and use it in GitHub Desktop.
$1以下のファイル名を$2以下にローマ字に変換して保存する。
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
#! /bin/bash | |
set -e | |
function main () { | |
local jafname=$* | |
local enfname=`echo $jafname | nkf -e | kakasi -Ha -Ka -Ja -Ea -o utf-8` | |
local enfname=$2${enfname#*MP3} | |
mkdir -p "${enfname%/*}" | |
cp ${jafname/ /\ } ${enfname/ /\ } | |
} | |
export -f main | |
find $1 -type f -print0 \ | |
| xargs -0 -n1 -I@ bash -c "main @" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment