
{"id":1720,"date":"2010-06-23T10:54:35","date_gmt":"2010-06-23T05:24:35","guid":{"rendered":"http:\/\/www.jeffrin.in\/?p=1720"},"modified":"2010-06-23T10:54:35","modified_gmt":"2010-06-23T05:24:35","slug":"grep-m-stop-reading-a-file","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2010\/06\/23\/grep-m-stop-reading-a-file\/","title":{"rendered":"grep .. -m .. stop reading a file&#8230;"},"content":{"rendered":"<pre>\n-m\nStop reading a file after NUM matching lines.\n<\/pre>\n<pre>\n$grep -m 1  wc  wcwidth.c\n#include \n$grep -m 2  wc  wcwidth.c\n#include \nwchar_t cr;\n$grep -m 3  wc  wcwidth.c\n#include \nwchar_t cr;\nvalue=wcwidth(cr);\n$grep -m 4  wc  wcwidth.c\n#include \nwchar_t cr;\nvalue=wcwidth(cr);\n$grep -m 0  wc  wcwidth.c\n$\n<\/pre>\n<pre>\nscripts\/makelst - 338 identical\n\n    19: t1=`$3 --syms $1 | grep .text | grep -m1 \" F \"`\n    20: if [ -n \"$t1\" ]; then\n\nandroid.git.kernel.org\/kernel\/common.git - GPL - Shell\n<\/pre>\n<pre>\nSearching for a pattern in a text file is a very common operation\n in many applications ranging from text editors and databases to\n applications in molecular biology. In many instances the pattern\ndoes not appear in the text exactly. Errors in the text or in the\n query can result from misspelling or from experimental errors\n (e.g., when the text is a DNA sequence). The use of such\n approximate pattern matching has been limited until now to\n specific applications. Most text editors and searching programs\n do not support searching with errors because of the com-\nplexity involved in implementing it. In this paper we describe a\nnew tool, called agrep, for approximate pattern matching. Agrep\n is based on a new efficient and flexible algorithm for approximate\n string matching. Agrep is also competitive with other tools for\n exact string matching; it include many options that make\n searching more powerful and convenient.\n\nsource :\n\nAGREP \u2014 A FAST APPROXIMATE PATTERN-MATCHING TOOL\n(Preliminary version)\nSun Wu and Udi Manber1\nDepartment of Computer Science\nUniversity of Arizona\nTucson, AZ 85721\n(sw | udi)@cs.arizona.edu\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>-m Stop reading a file after NUM matching lines. $grep -m 1 wc wcwidth.c #include $grep -m 2 wc wcwidth.c #include wchar_t cr; $grep -m 3 wc wcwidth.c #include wchar_t cr; value=wcwidth(cr); $grep -m 4 wc wcwidth.c #include wchar_t cr; value=wcwidth(cr); $grep -m 0 wc wcwidth.c $ scripts\/makelst &#8211; 338 identical 19: t1=`$3 &#8211;syms $1 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2010\/06\/23\/grep-m-stop-reading-a-file\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;grep .. -m .. stop reading a file&#8230;&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[863,1030,1098,1188],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/1720"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=1720"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/1720\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=1720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=1720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=1720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}