iconv -r 야매질

gentoo 2007. 12. 18. 20:02
badung@badung ~ $ cat convertfromcp949toutf8.sh
#!/bin/bash

if [ -z $1 ]
then
        echo "No input file."
        echo "Usage: $0 inputfile"
        exit 0
fi

for file in "$@"
do
        if [ ! -f $file ]
        then
                echo "$file is not regular file. Cannot convert"
        else
                echo "Converting... $file"
                cp $file "$file.bak"
                iconv -f cp949 -t utf8 $file > "$file.tmp"
                mv "$file.tmp" $file
        fi
done

# find ./ *.log -exec ~/convertfromcp949toutf8.sh {} \;
Posted by badung
,