Skip to content

Instantly share code, notes, and snippets.

@jintao-zero
Created November 27, 2017 02:18
Show Gist options
  • Save jintao-zero/4e3c7943b7216c9f4030f176b2b0872f to your computer and use it in GitHub Desktop.
Save jintao-zero/4e3c7943b7216c9f4030f176b2b0872f to your computer and use it in GitHub Desktop.
iconv a directory
#!/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