<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: script/cmd required for avoiding the lines containing a search word in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3143995#M156044</link>
    <description>Hi&lt;BR /&gt;&lt;BR /&gt;ignore my first grep that will remove all lines with mathi&lt;BR /&gt;&lt;BR /&gt;grep -v " mathi " filename &amp;gt; newfile&lt;BR /&gt;&lt;BR /&gt;:-) &lt;BR /&gt;&lt;BR /&gt;JOhn.</description>
    <pubDate>Sat, 13 Dec 2003 07:05:05 GMT</pubDate>
    <dc:creator>John Carr_2</dc:creator>
    <dc:date>2003-12-13T07:05:05Z</dc:date>
    <item>
      <title>script/cmd required for avoiding the lines containing a search word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3143992#M156041</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I want a script / command which'll avoid all the lines containing the word "mathi" &amp;amp; not "mathivanan" or "abcmathitest" from my i/p file.....my sample i/p files looks as follows:&lt;BR /&gt;&lt;BR /&gt;-------------------------------&lt;BR /&gt;1 mathi a bcdtest&lt;BR /&gt;2xyz mathivanan hopeso&lt;BR /&gt;3 hanry&lt;BR /&gt;4karthik s s mathi&lt;BR /&gt;5 Michael Schulte mathiabc&lt;BR /&gt;6 Pete Randall testmathi&lt;BR /&gt;7Klaas D. Eenkhoorn mathi&lt;BR /&gt;8john korterman aa mathi&lt;BR /&gt;9 Dave La Mar smathia&lt;BR /&gt;-------------------------------&lt;BR /&gt;&lt;BR /&gt;I want the ouput after avoiding the lines containing exactly the word "mathi".....which'll be as follows:&lt;BR /&gt;&lt;BR /&gt;-------------------------------&lt;BR /&gt;2xyz mathivanan hopeso&lt;BR /&gt;3 hanry&lt;BR /&gt;5 Michael Schulte mathiabc&lt;BR /&gt;6 Pete Randall testmathi&lt;BR /&gt;7Klaas D. Eenkhoorn mathi&lt;BR /&gt;9 Dave La Mar smathia&lt;BR /&gt;-------------------------------&lt;BR /&gt;&lt;BR /&gt;I hope I made my requirement very clear......I want to know how i can get this by way of "grep" or any script which'll do this job for me......&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.....&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;karthik</description>
      <pubDate>Sat, 13 Dec 2003 06:41:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3143992#M156041</guid>
      <dc:creator>Karthikeyan_5</dc:creator>
      <dc:date>2003-12-13T06:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: script/cmd required for avoiding the lines containing a search word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3143993#M156042</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;grep -v mathi filename &amp;gt; newfile&lt;BR /&gt;&lt;BR /&gt;-v means do not include any lines with given search string&lt;BR /&gt;&lt;BR /&gt;John.</description>
      <pubDate>Sat, 13 Dec 2003 06:57:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3143993#M156042</guid>
      <dc:creator>John Carr_2</dc:creator>
      <dc:date>2003-12-13T06:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: script/cmd required for avoiding the lines containing a search word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3143994#M156043</link>
      <description>perl -n -e 'if(not /\bmathi\b/){print}' testfile&lt;BR /&gt; &lt;BR /&gt;But in your example line 7 contains the word "mathi" too so it presumably should be avoided.</description>
      <pubDate>Sat, 13 Dec 2003 06:58:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3143994#M156043</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-12-13T06:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: script/cmd required for avoiding the lines containing a search word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3143995#M156044</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;ignore my first grep that will remove all lines with mathi&lt;BR /&gt;&lt;BR /&gt;grep -v " mathi " filename &amp;gt; newfile&lt;BR /&gt;&lt;BR /&gt;:-) &lt;BR /&gt;&lt;BR /&gt;JOhn.</description>
      <pubDate>Sat, 13 Dec 2003 07:05:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3143995#M156044</guid>
      <dc:creator>John Carr_2</dc:creator>
      <dc:date>2003-12-13T07:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: script/cmd required for avoiding the lines containing a search word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3143996#M156045</link>
      <description>Hi,&lt;BR /&gt;try the attached script, using your input file as $1&lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;John K</description>
      <pubDate>Sat, 13 Dec 2003 08:55:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3143996#M156045</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2003-12-13T08:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: script/cmd required for avoiding the lines containing a search word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3143997#M156046</link>
      <description>Please help me understand why you want line 7 in the output, and not line 4. What sets them apart? Is this a problem with the forum stripping spaces? If so, I woudl recommend to ATTACH sample input as a file as well as displaying it.&lt;BR /&gt;&lt;BR /&gt;The grep solution should be:&lt;BR /&gt;&lt;BR /&gt;grep -E -v '(^| )mathi( |$)' x&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;grep -E -v '(^|[ ])mathi([  ]|$)' x&lt;BR /&gt;if you anticipate tabs or spaces and have entered a space and a tab (\t ^V^I) in the match box []&lt;BR /&gt;&lt;BR /&gt;I like the perl solution better using the powerful "\b" word boundary.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;To bad you did not search for, or failed to find, the following threads, which discuss much similar problems:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=292228" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=292228&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=284829" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=284829&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Sat, 13 Dec 2003 09:35:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3143997#M156046</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2003-12-13T09:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: script/cmd required for avoiding the lines containing a search word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3143998#M156047</link>
      <description>Hi Karthis,&lt;BR /&gt;&lt;BR /&gt;please read the statement made in the other thread regarding the comment of Hein.&lt;BR /&gt;&lt;BR /&gt;What the solution is concerned, according to your specifications line 7 shouldnt show up. I attach a modified awk script, which I used in the other thread. Perhaps it helps you.&lt;BR /&gt;run it with&lt;BR /&gt;awk -f yourscriptname filetosearch.&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Sat, 13 Dec 2003 17:17:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3143998#M156047</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-13T17:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: script/cmd required for avoiding the lines containing a search word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3143999#M156048</link>
      <description>Oops, where did the attachment go?&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Sat, 13 Dec 2003 17:19:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3143999#M156048</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-13T17:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: script/cmd required for avoiding the lines containing a search word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3144000#M156049</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;First Thanks for all of u'r help/responses....&lt;BR /&gt;&lt;BR /&gt;Also in my sample output "line 7" shouldn't be present.....sorry its by mistake.......&lt;BR /&gt;&lt;BR /&gt;Perl is not installed in our HP-UX server....so i couldn't able to try it out....&amp;amp; also the scripts attached by "john korterman" &amp;amp; "Michael Schulte" b'coz I am new to scripting......also the command given by "Hein van den Heuvel" was very simple:&lt;BR /&gt;&lt;BR /&gt;"grep -E -v '(^| )mathi( |$)' x" &lt;BR /&gt;&lt;BR /&gt;But "Hein" can u pls tell me what is the meaning of (^| ) &amp;amp; ( |$)...i.e. starting &amp;amp; ending i suppose....but y opening "(" &amp;amp; closing ")" brackets are required......&lt;BR /&gt;&lt;BR /&gt;Also I am very very sorry that there is some modification in my sample OUTPUT.......&lt;BR /&gt;&lt;BR /&gt;1) first from the i/p file i should avoid all the lines containg only the word "mathi"......the output is as follows:&lt;BR /&gt;&lt;BR /&gt;-------------------------------&lt;BR /&gt;2xyz mathivanan hopeso&lt;BR /&gt;3 hanry&lt;BR /&gt;5 Michael Schulte mathiabc&lt;BR /&gt;6 Pete Randall testmathi&lt;BR /&gt;9 Dave La Mar smathia&lt;BR /&gt;-------------------------------&lt;BR /&gt;&lt;BR /&gt;2) secondly, in turn from the above output it should further DELETE/AVOID the alternate lines (assume all EVEN lines from the above output).......the sample output for this is some what like:&lt;BR /&gt;&lt;BR /&gt;-------------------------------&lt;BR /&gt;2xyz mathivanan hopeso&lt;BR /&gt;5 Michael Schulte mathiabc&lt;BR /&gt;9 Dave La Mar smathia&lt;BR /&gt;-------------------------------&lt;BR /&gt;&lt;BR /&gt;3) Finally, from the above output, the 2 2 lines should be appended to the first line of that 2 lines with a SPACE separated. The sample output is as follows:&lt;BR /&gt;&lt;BR /&gt;-------------------------------&lt;BR /&gt;2xyz mathivanan hopeso 5 Michael Schulte mathiabc&lt;BR /&gt;9 Dave La Mar smathia&lt;BR /&gt;-------------------------------&lt;BR /&gt;&lt;BR /&gt;That's it......thanks in advance.......&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;karthik</description>
      <pubDate>Sun, 14 Dec 2003 23:10:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3144000#M156049</guid>
      <dc:creator>Karthikeyan_5</dc:creator>
      <dc:date>2003-12-14T23:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: script/cmd required for avoiding the lines containing a search word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3144001#M156050</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;First, there is a '-w' option to grep to get only matching "words". It works in your case ... So the simple script could be :&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;grep -vw mathi yourfile | awk '&lt;BR /&gt;{&lt;BR /&gt;  line=$0&lt;BR /&gt;  getline&lt;BR /&gt;  getline&lt;BR /&gt;  printf "%s %s\n", line, $0&lt;BR /&gt;  getline&lt;BR /&gt;}'&lt;BR /&gt;&lt;BR /&gt;The ouput should be what you need ...&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Mon, 15 Dec 2003 02:40:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3144001#M156050</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2003-12-15T02:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: script/cmd required for avoiding the lines containing a search word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3144002#M156051</link>
      <description>&lt;BR /&gt;grep -w &lt;BR /&gt;&lt;BR /&gt;I have not seen this before and its not on my version of 11.00 can anyone clarify this option please.&lt;BR /&gt;&lt;BR /&gt;John.</description>
      <pubDate>Mon, 15 Dec 2003 06:09:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3144002#M156051</guid>
      <dc:creator>John Carr_2</dc:creator>
      <dc:date>2003-12-15T06:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: script/cmd required for avoiding the lines containing a search word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3144003#M156052</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;From "man grep" on 11i:&lt;BR /&gt;&lt;BR /&gt;-w                  Select only those lines containing matches&lt;BR /&gt;                               that form whole words. The test is that the&lt;BR /&gt;                               matching substring must either be at the&lt;BR /&gt;                               beginning of the line, or preceded by a non-&lt;BR /&gt;                               word constituent character.  Similarly, it&lt;BR /&gt;                               must be either at the end of the line or&lt;BR /&gt;                               followed by a non-word constituent character.&lt;BR /&gt;                               Word-constituent characters are letters,&lt;BR /&gt;                               digits, and the underscore.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Mon, 15 Dec 2003 06:27:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3144003#M156052</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-12-15T06:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: script/cmd required for avoiding the lines containing a search word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3144004#M156053</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;It comes with 11.11 I think ...&lt;BR /&gt;&lt;BR /&gt;Hewlett-Packard Company            - 2 -   HP-UX Release 11i: November 2000&lt;BR /&gt;&lt;BR /&gt; grep(1)                                                             grep(1)&lt;BR /&gt;&lt;BR /&gt;           -w                  Select only those lines containing matches&lt;BR /&gt;                               that form whole words. The test is that the&lt;BR /&gt;                               matching substring must either be at the&lt;BR /&gt;                               beginning of the line, or preceded by a non-&lt;BR /&gt;                               word constituent character.  Similarly, it&lt;BR /&gt;                               must be either at the end of the line or&lt;BR /&gt;                               followed by a non-word constituent character.&lt;BR /&gt;                               Word-constituent characters are letters,&lt;BR /&gt;                               digits, and the underscore.&lt;BR /&gt;</description>
      <pubDate>Mon, 15 Dec 2003 06:27:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3144004#M156053</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2003-12-15T06:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: script/cmd required for avoiding the lines containing a search word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3144005#M156054</link>
      <description>Hi Karthik,&lt;BR /&gt;&lt;BR /&gt;(^| )mathi( |$)&lt;BR /&gt;&lt;BR /&gt;It means, mathi is supposed to be at the start of a line or preceeded by a space and followed by a space or end of line.&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Mon, 15 Dec 2003 06:28:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3144005#M156054</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-15T06:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: script/cmd required for avoiding the lines containing a search word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3144006#M156055</link>
      <description>can you donate a little time and assign points to all the people who gave up there time to help you :-)&lt;BR /&gt;&lt;BR /&gt;company name:     &lt;BR /&gt;country: india &lt;BR /&gt;personal quote:  &lt;BR /&gt;certification:  &lt;BR /&gt;ITRC member since: May 28, 2003  &lt;BR /&gt;last contribution date: December 15, 2003  &lt;BR /&gt;I have assigned points to   9  of   86  responses to my questions.  &lt;BR /&gt;</description>
      <pubDate>Mon, 15 Dec 2003 07:02:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3144006#M156055</guid>
      <dc:creator>John Carr_2</dc:creator>
      <dc:date>2003-12-15T07:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: script/cmd required for avoiding the lines containing a search word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3144007#M156056</link>
      <description>Hi Karthik,&lt;BR /&gt;&lt;BR /&gt;what about this attachment. Put it in a file lets say kart.awk, then:&lt;BR /&gt;awk -f kart.awk filetogrep&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Mon, 15 Dec 2003 18:09:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3144007#M156056</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-15T18:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: script/cmd required for avoiding the lines containing a search word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3144008#M156057</link>
      <description>Hi Karthik,&lt;BR /&gt;&lt;BR /&gt;what about this attachment. Put it in a file lets say kart.awk, then:&lt;BR /&gt;awk -f kart.awk filetogrep&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Mon, 15 Dec 2003 18:09:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3144008#M156057</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-15T18:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: script/cmd required for avoiding the lines containing a search word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3144009#M156058</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;first of all thanks for all of u'r responses......&lt;BR /&gt;&lt;BR /&gt;Jean-Louis Phelix: &lt;BR /&gt;&lt;BR /&gt;I am using HP-UX 10.2....so i think "-w" option of "grep" is rulled out.....&lt;BR /&gt;&lt;BR /&gt;Michael Schulte:&lt;BR /&gt; &lt;BR /&gt;----------------------&lt;BR /&gt;(^| )mathi( |$)&lt;BR /&gt;&lt;BR /&gt;It means, mathi is supposed to be at the start of a line or preceeded by a space and followed by a space or end of line.&lt;BR /&gt;----------------------&lt;BR /&gt;assume in my case, the word MATHI is preceeded &amp;amp; follwed by space....and not start or end......in this case, if put ' mathi '......i.e.&lt;BR /&gt;&lt;BR /&gt;grep -v ' mathi ' filename&lt;BR /&gt;&lt;BR /&gt;but I am not getting the required output.....can u pls explain.......also as I mentioned in my prev. post......i am new to scripting &amp;amp; also the script u gave is some what confusing for me b'coz i am not familiar with scripting na.......sorry my dear.....&lt;BR /&gt;&lt;BR /&gt;John Carr:&lt;BR /&gt;&lt;BR /&gt;I'll surely assign points for those who have helped me......i.e. assigning points comes into picture only at the ending stage of the topic...right.....so y r u hurrying my dear friend.......b'coz in my later post....as I mentioned there is some change in my output requirement.....only a part of it is complete &amp;amp; other 2 parts are remaining.......&lt;BR /&gt;&lt;BR /&gt;waiting to c all of u'r responses......&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;karthik&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Dec 2003 00:10:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3144009#M156058</guid>
      <dc:creator>Karthikeyan_5</dc:creator>
      <dc:date>2003-12-16T00:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: script/cmd required for avoiding the lines containing a search word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3144010#M156059</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;OK ... without -w option, this one could work :&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;grep -v -E '^mathi | mathi | mathi$' /tmp/a | awk '&lt;BR /&gt;{&lt;BR /&gt;  line=$0&lt;BR /&gt;  getline&lt;BR /&gt;  getline&lt;BR /&gt;  printf "%s %s\n", line, $0&lt;BR /&gt;  getline&lt;BR /&gt;}'&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Tue, 16 Dec 2003 02:04:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3144010#M156059</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2003-12-16T02:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: script/cmd required for avoiding the lines containing a search word</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3144011#M156060</link>
      <description>Hi Karthik,&lt;BR /&gt;&lt;BR /&gt;you dont need to change the grep of Hein. grep tries any combination of what you give it and grep -E -v '(^| )mathi( |$)' is equivalent to:&lt;BR /&gt;grep -E -v '^mathi ' or&lt;BR /&gt;grep -E -v ' mathi$' or&lt;BR /&gt;grep -E -v '^mathi$' or&lt;BR /&gt;grep -E -v ' mathi '.&lt;BR /&gt;&lt;BR /&gt;But grep is not sufficient enough here.&lt;BR /&gt;&lt;BR /&gt;Have you tried the awk script in my atachment?&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Dec 2003 06:54:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-cmd-required-for-avoiding-the-lines-containing-a-search/m-p/3144011#M156060</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-16T06:54:10Z</dc:date>
    </item>
  </channel>
</rss>

