Created
November 27, 2017 02:18
-
-
Save jintao-zero/4e3c7943b7216c9f4030f176b2b0872f to your computer and use it in GitHub Desktop.
iconv a directory
This file contains hidden or 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/env sh | |
echo 'start iconv...' | |
dir=$1 | |
echo ${dir} | |
for f in ${dir}/* | |
do | |
echo ${f} | |
name=`basename ${f}` | |
echo ${name} | |
`iconv -f gbk -t utf8 ${f} > /tmp/${name}` | |
`mv /tmp/${name} ${f}` | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment