{"id":1385,"date":"2005-02-23T09:42:54","date_gmt":"2005-02-23T09:42:54","guid":{"rendered":"http:\/\/dev.jblove.net\/?p=1385"},"modified":"2005-02-23T09:42:54","modified_gmt":"2005-02-23T09:42:54","slug":"%ed%8a%b9%ec%a0%95-%eb%ac%b8%ec%9e%a5%ec%9d%84-%ed%8f%ac%ed%95%a8%ed%95%98%ec%a7%80-%ec%95%8a%eb%8a%94-%ed%8c%8c%ec%9d%bc%eb%93%a4-%ec%b0%be%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/jblove.net\/?p=1385","title":{"rendered":"\ud2b9\uc815 \ubb38\uc7a5\uc744 \ud3ec\ud568\ud558\uc9c0 \uc54a\ub294 \ud30c\uc77c\ub4e4 \ucc3e\uae30"},"content":{"rendered":"<p><?<br \/>\n\/* &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n\ud2b9\uc815 \ub2e8\uc5b4\ub97c \ud3ec\ud568\ud558\uc9c0 \uc54a\ub294 \ud30c\uc77c \ucc3e\uae30<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; *\/<br \/>\n$target_dir=&#8221;\/home&#8221;; \/\/ \uac80\uc0c9 \ub514\ub809\ud1a0\ub9ac<br \/>\n$ignore_dir=array(&#8220;\/image\/&#8221;,&#8221;\/jumun_prod_photo\/&#8221;,&#8221;\/board1_files\/&#8221;,&#8221;\/images\/&#8221;,&#8221;\/img\/&#8221;,&#8221;\/prod_images\/&#8221;,&#8221;\/css\/&#8221;,&#8221;\/upload\/&#8221;,&#8221;\/log&#8221;,&#8221;\/js&#8221;,&#8221;\/temp&#8221;); \/\/ \uac80\uc0c9\ud558\uc9c0 \uc54a\uc744 \ud558\uc704 \ub514\ub809\ud1a0\ub9ac<\/p>\n<p>function r_grep($target,$str) {<br \/>\n    global $ignore_dir;<br \/>\n    $d = @dir($target);<\/p>\n<p>    if(!$d) die(&#8220;<b>$target<\/b> is Not Directory Or Not Found Directory Path <\/p>\n<p>&#8220;);<\/p>\n<p>    echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; <br \/>&#8220;;<br \/>\n    \/\/echo &#8220;Handle: &#8221; . $d->handle . &#8220;<\/p>\n<p>&#8220;;<br \/>\n    echo &#8220;<b>Path: &#8221; . $d->path . &#8220;<\/b><\/p>\n<p>&#8220;;<\/p>\n<p>    while (false !==($entry = $d->read())) {<br \/>\n        if ($entry == &#8216;.&#8217; || $entry == &#8216;..&#8217;) continue;<\/p>\n<p>        $file_path=$target.&#8221;\/&#8221;.$entry;<\/p>\n<p>        if (is_dir($file_path)){<br \/>\n            r_grep($file_path,$str);<br \/>\n        }else{<br \/>\n            reset($ignore_dir);<br \/>\n            $ignore=false;<br \/>\n            while(list($key,$val)= each($ignore_dir)){<br \/>\n                if(strstr($file_path,$val)){<br \/>\n                    $ignore=true;<br \/>\n                }<br \/>\n            }<br \/>\n            if($ignore) continue;<\/p>\n<p>            $fcontents = file ($file_path);<br \/>\n            $find=false;<br \/>\n            while (list ($line_num, $line) = each ($fcontents)) {<br \/>\n                \/\/echo &#8220;<b>Line $line_num:<\/b> &#8221; . htmlspecialchars ($line) . &#8220;<\/p>\n<p>&#8220;;<br \/>\n                if(strstr($line,$str)) {<br \/>\n                    $find=true;<br \/>\n                    continue;<br \/>\n                }<br \/>\n            }<\/p>\n<p>            if(!$find) echo &#8220;$file_path <br \/>&#8220;;<\/p>\n<p>        }<br \/>\n    }<br \/>\n    echo &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; <br \/>&#8220;;<br \/>\n    $d->close();    <br \/>\n}<\/p>\n<p>if($mode==&#8221;submit&#8221;){    <br \/>\n    r_grep($target_dir,$str);<br \/>\n}<\/p>\n<p>echo&#8221;<br \/>\n<script language=javascript><br \/>\nfunction check(f){<br \/>\n    if(!document.form.str.value){<br \/>\n        alert('\uac80\uc0c9\uc5b4\ub97c \uc785\ub825\ud558\uc5ec \uc8fc\uc2ed\uc2dc\uc694');<br \/>\n        f.str.focus();<br \/>\n        return false;    <br \/>\n    }<br \/>\n    return true;<br \/>\n}<br \/>\n<\/script><br \/>\n$target_dir \ub514\ub809\ud1a0\ub9ac \ud558\uc704\ub97c \uac80\uc0c9\ud558\uc5ec \uac80\uc0c9\uc5b4\ub97c \ud3ec\ud568\ud558\uace0 \uc788\uc9c0 \uc54a\uc740 \ud30c\uc77c\uc744 \ucc3e\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uac80\uc0c9\uc5b4\ub97c \uc785\ub825\ud558\uc5ec \uc8fc\uc2ed\uc2dc\uc694<\/p>\n<form name=form method=post action='$_SERVER[PHP_SELF]' onSubmit=\"return check(this)\">\n<input type=hidden name=mode value='submit'><br \/>\n<input type=text name='str' value='$str'> <input type=submit><br \/>\n<\/form>\n<p>\n&#8220;;<br \/>\n?> <\/p>\n<p> \uc544\uc8fc\uc791\uc740\uc0c8 \uba54\ub274\uc5bc\uc5d0\uc11c \uc9dc\uc9d1\uae30 \ud55c\uac81\ub2c8\ub2e4.<br \/>\n^^<br \/>\n\uc791\uc5c5\ud558\ub2e4 \ubcf4\uba74 \uc5c5\uadf8\ub808\uc774\ub4dc \ub41c \ud30c\uc77c\uc744 \uacf5\ud1b5\uc801\uc73c\ub85c \ub2e4\uc2dc \uc62c\ub824\uc57c \ud560\uc77c\uc774 \uc885\uc885 \uc788\ub294\ub370 \ube60\ub728\ub9b4\ub54c\ub3c4 \uc788\ub354\uad70\uc694<br \/>\n\uadf8\ub798\uc11c \uccb4\ud06c \uc6a9\ub3c4\ub85c \uc0ac\uc6a9\ud560\ub824\uace0 \ub9cc\ub4e4\uc5c8\uc2b5\ub2c8\ub2e4.<br \/>\n\ub534\uc9c0 \ub178 02\/23 12:04:06  <\/p>\n<p> \ucd08\ubcf4 \ud2b9\uc815 \ub2e8\uc5b4\ub97c \ud3ec\ud568\ud558\ub294 \ud30c\uc77c\uc744 \uac80\uc0c9\ud574 \ubcf4\ub824\uba74 \uc5b4\ub5bb\uac8c \ud558\uba74 \ub418\ub294\uc9c0 \uc18c\uc2a4\ub3c4 \uc18c\uac1c\ud574 \uc8fc\uc2dc\uba74 \uac10\uc0ac\ud558\uaca0\uc2b5\ub2c8\ub2e4. 02\/23 16:25:59  <\/p>\n<p> \uae40\uc815\uade0 \ubb50 \ub2e4\ub978 \ubc29\ubc95\uc73c\ub85c\ub3c4..<\/p>\n<p>* \ud2b9\uc815 \ubb38\uc7a5 \ud3ec\ud568\ub41c \ud30c\uc77c \ucc3e\uae30<\/p>\n<p>grep -r &#8220;REGEX&#8221; *<\/p>\n<p>* \ud2b9\uc815 \ubb38\uc7a5\uc774 \ud3ec\ud568\ub418\uc9c0 \uc54a\uc740 \ud30c\uc77c \ucc3e\uae30<\/p>\n<p>grep -r -v &#8220;REGEX&#8221; * 02\/23 16:41:00  <\/p>\n<p> \uc544\uc8fc\uc791\uc740\uc0c8 grep -r -v &#8220;REGEX&#8221; *<br \/>\n\ub294 \ud2b9\uc815 \ubb38\uc7a5\uc774 \ud3ec\ud568\ub418\uc9c0 \uc54a\ub294 \ud589 \ucc3e\uae30 \uc774\ub370\uc694.<br \/>\n\uac70\uae30\uc11c \ud30c\uc77c\uba85\ub9cc \ub098\uc624\uac8c \ud560\uc218 \uc788\ub2e4\uba74 \uc815\ub9d0 \uc88b\uc558\uc744 \uac83\uc744 &#8230;.<br \/>\n\uadf8\ub798\uc11c \ub9cc\ub4e0\uac8c \uc704\uc5d0 \uc18c\uc2a4\uac70\ub4e0\uc694<\/p>\n<p>\ud639\uc2dc \uc544\uc2dc\ub294 \ubd84? 02\/23 16:44:39  <\/p>\n<p> \uac70\uce5c\ub9c8\ub8e8 grep -r -L &#8220;REGEX&#8221; *<br \/>\n 02\/23 17:06:48  <\/p>\n<p> \uc544\uc8fc\uc791\uc740\uc0c8 \uac70\uce5c\ub9c8\ub8e8\ub2d8 \uac10\uc0ac\ud569\ub2c8\ub2e4<br \/>\n\uad73\uc774\ub124\uc694 02\/23 17:19:57  <\/p>\n<p> \uc815\ud0dc\uc601 # sh \ubc84\uc83c =3=33<br \/>\nfor X in `find .\/ -type f`;do<br \/>\ndata=` cat $X | grep &#8220;REGEX&#8221; `<br \/>\nif [ $? -eq 0 ];then<br \/>\necho $X<br \/>\necho $data<br \/>\nfi<br \/>\ndone <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uc544\uc8fc\uc791\uc740\uc0c8 \uba54\ub274\uc5bc\uc5d0\uc11c \uc9dc\uc9d1\uae30 \ud55c\uac81\ub2c8\ub2e4. ^^ \uc791\uc5c5\ud558\ub2e4 \ubcf4\uba74 \uc5c5\uadf8\ub808\uc774\ub4dc \ub41c \ud30c\uc77c\uc744 \uacf5\ud1b5\uc801\uc73c\ub85c \ub2e4\uc2dc \uc62c\ub824\uc57c \ud560\uc77c\uc774 \uc885\uc885 \uc788\ub294\ub370 \ube60\ub728\ub9b4\ub54c\ub3c4 \uc788\ub354\uad70\uc694 \uadf8\ub798\uc11c \uccb4\ud06c \uc6a9\ub3c4\ub85c \uc0ac\uc6a9\ud560\ub824\uace0 \ub9cc\ub4e4\uc5c8\uc2b5\ub2c8\ub2e4. \ub534\uc9c0 \ub178 02\/23 12:04:06 \ucd08\ubcf4 \ud2b9\uc815 \ub2e8\uc5b4\ub97c \ud3ec\ud568\ud558\ub294 \ud30c\uc77c\uc744 \uac80\uc0c9\ud574 \ubcf4\ub824\uba74 \uc5b4\ub5bb\uac8c \ud558\uba74 \ub418\ub294\uc9c0 \uc18c\uc2a4\ub3c4 \uc18c\uac1c\ud574 \uc8fc\uc2dc\uba74 \uac10\uc0ac\ud558\uaca0\uc2b5\ub2c8\ub2e4. 02\/23 16:25:59 \uae40\uc815\uade0 \ubb50 \ub2e4\ub978 \ubc29\ubc95\uc73c\ub85c\ub3c4.. * \ud2b9\uc815 \ubb38\uc7a5 \ud3ec\ud568\ub41c \ud30c\uc77c \ucc3e\uae30 grep -r [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[51],"tags":[],"class_list":["post-1385","post","type-post","status-publish","format-standard","hentry","category-papa-php"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts\/1385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1385"}],"version-history":[{"count":0,"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts\/1385\/revisions"}],"wp:attachment":[{"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}