RSS구독하기:SUBSCRIBE TO RSS FEED
즐겨찾기추가:ADD FAVORITE
글쓰기:POST
관리자:ADMINISTRATOR
'Perl'에 해당되는 글 1

이건 참 리눅스에 대단한 강점이라고 할 수 있는 부분이다.

놀랍지 아니 한가!


여기에서는 perl을 이용하였지만, sed 를 이용하여서도 가능하다.


그리고 혹시 모를상황을 대비하여 백업파일을 생성하고 싶다면

perl -pi -e 에서 perl -pi.bak -e 를 추가하면 자동적으로 "파일이름.bak"가 생성된다.


파일속 mms: 찾기
find . -type f -name "dunetCont.html" -exec grep "mms://vod.xxxx.co.kr" {} /dev/null \;


파일 속 IP 변경하기

find . -type f -name "dunetCont.html" -exec perl -pi -e 's/211.xx.xx.39/vod.xxxx.co.kr/g' {} \;
find . -type f -name "i_pg*.html" -exec perl -pi -e 's/211.xx.xx.39/vod.xxxx.co.kr/g' {} \;
find . -type f -name "[0,1][0-9].html" -exec perl -pi -e 's/211.xx.xx.39/vod.xxxx.co.kr/g' {} \;

압축
for i in $(find . -name 'Cont.html'); do tar -rvf Cont.tgz $i; done


K-IFRS(04.html , 09.html , 14.html , 19.html , 24.html)
for i in $(find *_10103* -name [0,1,2][4,9].html); do tar -rvf IFRS.tar $i; done
find . -type f -name [0,1,2][4,9].html -exec perl -pi -e 's/211.xx.xx.39/vod.xxxxt.co.kr/g' {} \;


수정하기 스크립트
find . -type f -name "dunetCont.html" -exec perl -pi -e 's/211.xx.xx.39/vod.xxxx.co.kr/g' {} \;
find . -type f -name [0,1,2][4,9].html -exec perl -pi -e 's/211.xx.xx.39/vod.xxxx.co.kr/g' {} \;

Trackback
Reply
우주곰:지구곰이 아닙니다.
지구곰이 아닙니다.
Categories (190)
Information (5)
About uzoogom (5)
Blah.. blah.. (5)
My Advanced Linux (73)
RedHat Knowledge (10)
Advanced Linux (47)
Virtualization (7)
HA clustering (2)
Bash shell scripts (6)
Learning Linux (96)
Fundamental (41)
AdminCourse (32)
Security (23)
OperatingSystem (5)
AIX (2)
HPUX (3)
Databases (4)
Oralce (3)
Mysql (1)
OpenSource (1)
Tips! (1)
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31