쉘상에서 파일 인코딩하는 방법입니다.
#!/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에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5027 | 12년 전 | 3014 | ||
| 5026 | 12년 전 | 2686 | ||
| 5025 | 12년 전 | 3294 | ||
| 5024 | 12년 전 | 1016 | ||
| 5023 | 12년 전 | 840 | ||
| 5022 | 12년 전 | 2011 | ||
| 5021 | 12년 전 | 1506 | ||
| 5020 | 12년 전 | 1103 | ||
| 5019 | 12년 전 | 2095 | ||
| 5018 |
프로프리랜서
|
12년 전 | 1317 | |
| 5017 |
프로프리랜서
|
12년 전 | 789 | |
| 5016 |
프로프리랜서
|
12년 전 | 1322 | |
| 5015 |
프로프리랜서
|
12년 전 | 830 | |
| 5014 |
프로프리랜서
|
12년 전 | 1211 | |
| 5013 | 12년 전 | 3759 | ||
| 5012 | 12년 전 | 3934 | ||
| 5011 | 12년 전 | 1360 | ||
| 5010 | 12년 전 | 3842 | ||
| 5009 | 12년 전 | 2519 | ||
| 5008 | 12년 전 | 2227 | ||
| 5007 |
|
12년 전 | 1270 | |
| 5006 | 12년 전 | 1634 | ||
| 5005 | 12년 전 | 5154 | ||
| 5004 | 12년 전 | 1475 | ||
| 5003 |
|
12년 전 | 2089 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기