쉘상에서 파일 인코딩하는 방법입니다.
#!/bin/bash
if [ $# != 3 ]
then
echo "Usage : char_convert.sh [char_from] [char_to] [dir]"
exit 0
fi
if [ $# != 3 ]
then
echo "Usage : char_convert.sh [char_from] [char_to] [dir]"
exit 0
fi
charfrom=$1
charto=$2
objdir=$3
charto=$2
objdir=$3
for x in $(find $objdir -type f -name "*[php|inc|html?]") ; do
iconv -f $charfrom -t $charto $x > $x.utf-8
if [ $? != 0 ]
then
echo "-----------------------------------"
rm -f $x.utf-8
echo "deleted $x.utf-8"
else
echo "-----------------------------------"
rm -f '$x'
echo "deleted $x"
mv $x.utf-8 $x
echo "mv $x.utf-8 -> $x"
fi
if [ $? != 0 ]
then
echo "-----------------------------------"
rm -f $x.utf-8
echo "deleted $x.utf-8"
else
echo "-----------------------------------"
rm -f '$x'
echo "deleted $x"
mv $x.utf-8 $x
echo "mv $x.utf-8 -> $x"
fi
done
exit 0
게시판 목록
팁게시판
디자인과 관련된 유용한 정보를 공유하세요.
질문은 상단의 QA에서 해주시기 바랍니다.
질문은 상단의 QA에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 27 | 21년 전 | 5792 | ||
| 26 | 21년 전 | 3074 | ||
| 25 | 21년 전 | 6063 | ||
| 24 | 18년 전 | 3658 | ||
| 23 | 21년 전 | 3617 | ||
| 22 | 21년 전 | 4228 | ||
| 21 | 21년 전 | 3810 | ||
| 20 | 21년 전 | 4188 | ||
| 19 | 21년 전 | 6639 | ||
| 18 | 21년 전 | 4724 | ||
| 17 | 21년 전 | 6958 | ||
| 16 | 21년 전 | 4167 | ||
| 15 | 21년 전 | 2618 | ||
| 14 | 21년 전 | 4961 | ||
| 13 | 21년 전 | 3385 | ||
| 12 |
Recluse
|
21년 전 | 3862 | |
| 11 |
아우겐나이스
|
21년 전 | 3555 | |
| 10 |
Recluse
|
21년 전 | 3386 | |
| 9 | 21년 전 | 3951 | ||
| 8 | 21년 전 | 5133 | ||
| 7 | 21년 전 | 4692 | ||
| 6 | 21년 전 | 5649 | ||
| 5 | 21년 전 | 4063 | ||
| 4 | 21년 전 | 4818 | ||
| 3 | 21년 전 | 4670 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기