args.txt
#! /Bin/bash if [-Z $1] | [! -E $1] thenecho "Usage: cmd. sh input "exitfiecho $ 0for num in $ *; do echo" $ num "Done For I in $(SEQ-3 $ #); do echo $ I done for I in {0 .. 5} Do echo $ I done echo $ @ for (I = 4; I <7; I ++); Do echo $ I done echo "All: $ "trimreg =" s/\ (^ *\)\(. * [^] \) \ (* $ \)/\ 2/"tmpfile = 'cat/proc/sys/kernel/random/UUID 'while read line; do value =$ {line # * =} key =$ {line % = *} key = 'echo $ {key} | sed-e "$ {trimreg}" 'value = 'echo $ {Value} | sed-e "$ {trimreg}" 'If ["$ key" = "url"] Then url = $ value Elif ["$ key" = "beginwith"] Then beginwith = $ value Elif ["$ key" = "endwith"] Then endwith = $ value Elif ["$ key" = "pagereg"] Then pagereg = $ value Elif ["$ key" = "savepath"] Then savepath = $ value Elif ["$ key" = "prefix"] Then prefix = $ valueelif ["$ key "=" proxy "] thenproxy = $ value fi done <$1 echo" url: $ URL "Echo" beginw Ith: $ beginwith "Echo" pagereg: $ pagereg "Echo" endwith: $ endwith "Echo" Prefix: $ prefix "Echo" Proxy: $ proxy "Echo" savepath: $ savepath "Echo" tmpfile: $ tmpfile "If [-Z $ proxy] thencontent = 'curl-S $ URL | iconv-f gbk-T UTF-8 'elsecontent = 'curl-x $ proxy-S $ URL | iconv-f gbk-T UTF-8 'fi length = 'expr length "$ {content}" 'echo "Download: $ Length byte (s) "content =$ {content # * $ {beginwith} content =$ {content % $ {end With} *} length = 'expr length "$ {content}" 'echo "after filer: $ Length byte (s) "Echo $ content | grep-po" $ pagereg "| uniq> $ savepathawk '{A [$0] ++} end {for (m in) print m} '$ savepath> $ tmpfileif [! -Z $ prefix] thensed "s/^/$ prefix/g" $ tmpfile> $ savepathelsecp $ tmpfile $ savepathfrem-F $ tmpfile STR = "0000012345456789000000" Echo $ STR # STR = expr substr $ STR 1 2 # STR =$ {STR: 2: 3} STR =$ {STR # * 0} echo $ STR # trim the string STR = "s =" str = 'echo $ STR | sed-e "$ {trimreg }" 'echo [$ STR] echo $ STR | sed-e "$ {trimreg }"
Url = focus. news.163.combeginwith = <ul class = "focuslist-1" id = "focusTab-1"> pagereg = (? <= Href = \ ") http: // focus \. News \. 163 \. com/[\ D] +. +? (? = \ ") Endwith = <Div class =" con-4 "area Clearfix"> savepath = 163.txt