ShellUtils
From KBase
cygwin, wget, grep, sed 를 이용한 CHM 파일 받기
- http://htmlhelp.berlios.de/books/chm.php - PERL document 를 찾다가 이 사이트를 발견했다. 그동안 chm (Compiled HTML) 로 있었으면 좋을텐데 라고 생각했던 여러 툴들의 버전이 있었다.
- wget - 먼저 HTML 을 다운받는다.
wget http://htmlhelp.berlios.de/books/chm.php
- grep - 원하는 라인을 찾는다
grep -oP '\bftp://\S+?\.chm\b' chm.php
- 설명
- -o, --only-matching show only the part of a line matching PATTERN
- -P, --perl-regexp PATTERN is a Perl regular expression
- \b = word boundary
- \S = non whitespace
- +? = one or more, minimal match
- sed - 앞에 wget 을 붙여준다
sed 's/^/wget /'
- 전체 라인
grep -oP '\bftp://\S+?\.chm\b' chm.php | sed 's/^/wget /' | sh

