<?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: pattern search (shell script) in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796655#M720643</link>
    <description>Thanks friends!!!&lt;BR /&gt;Harry, actually I wanted to findout all the words from the text file which ends with "c", "h" or "at" (two chars).&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;-Sanjay</description>
    <pubDate>Thu, 29 Aug 2002 11:44:45 GMT</pubDate>
    <dc:creator>Sanjay Jadhav</dc:creator>
    <dc:date>2002-08-29T11:44:45Z</dc:date>
    <item>
      <title>pattern search (shell script)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796649#M720637</link>
      <description>Hello friends,&lt;BR /&gt;   Can anybody tell me how to do a pattern search for more than one character... example: I want search words whose last character is "c" or "h" or "at".&lt;BR /&gt;   Thanx in advance!&lt;BR /&gt;&lt;BR /&gt;-Sanjay</description>
      <pubDate>Thu, 29 Aug 2002 11:20:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796649#M720637</guid>
      <dc:creator>Sanjay Jadhav</dc:creator>
      <dc:date>2002-08-29T11:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: pattern search (shell script)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796650#M720638</link>
      <description>case $x in&lt;BR /&gt;*c|*h|*at) : blah&lt;BR /&gt; ;;&lt;BR /&gt;*x|*fdg|*gurgl) : booh&lt;BR /&gt; ;;&lt;BR /&gt;*) exit ;;&lt;BR /&gt;esac</description>
      <pubDate>Thu, 29 Aug 2002 11:22:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796650#M720638</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-08-29T11:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: pattern search (shell script)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796651#M720639</link>
      <description>Multiple pattern search&lt;BR /&gt;man grep&lt;BR /&gt;cat file | grep -e "at" -e "h" -e "c"&lt;BR /&gt;&lt;BR /&gt;Jean-Luc</description>
      <pubDate>Thu, 29 Aug 2002 11:25:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796651#M720639</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2002-08-29T11:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: pattern search (shell script)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796652#M720640</link>
      <description>Jean-Luc: "last character" =&lt;BR /&gt;&lt;BR /&gt;# ls -1 | egrep '(c|h|at)$'&lt;BR /&gt;&lt;BR /&gt;And 'cat' is (again) completely redundant and only cluttering the resources with an extra process:&lt;BR /&gt;&lt;BR /&gt;# grep -e at -e h -e c &amp;lt; file&lt;BR /&gt;&lt;BR /&gt;would perform your action a lot faster if the system is close to it's process limit</description>
      <pubDate>Thu, 29 Aug 2002 11:29:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796652#M720640</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-08-29T11:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: pattern search (shell script)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796653#M720641</link>
      <description>Agreed,&lt;BR /&gt;This is if the filter is to be applied on the output of a program/application.&lt;BR /&gt;I simulated this pgm with cat file&lt;BR /&gt;&lt;BR /&gt;otherwise&lt;BR /&gt;grep -e "at" -e "h" -e "c" filename&lt;BR /&gt;&lt;BR /&gt;Jean-Luc&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Aug 2002 11:35:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796653#M720641</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2002-08-29T11:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: pattern search (shell script)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796654#M720642</link>
      <description>How/Where are you going to use it?&lt;BR /&gt;&lt;BR /&gt;here's an example:&lt;BR /&gt;&lt;BR /&gt;cat somefile | grep -e "c$" -e "h$" -e "at$"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Aug 2002 11:38:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796654#M720642</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-08-29T11:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: pattern search (shell script)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796655#M720643</link>
      <description>Thanks friends!!!&lt;BR /&gt;Harry, actually I wanted to findout all the words from the text file which ends with "c", "h" or "at" (two chars).&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;-Sanjay</description>
      <pubDate>Thu, 29 Aug 2002 11:44:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796655#M720643</guid>
      <dc:creator>Sanjay Jadhav</dc:creator>
      <dc:date>2002-08-29T11:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: pattern search (shell script)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796656#M720644</link>
      <description>AHHHHHHH&lt;BR /&gt;&lt;BR /&gt;WORDS is the keyword here!&lt;BR /&gt;&lt;BR /&gt;try this&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;cat YOURFILE | grep -e "[c|h][ |$]" -e "at[ |$]"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Aug 2002 11:50:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796656#M720644</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-08-29T11:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: pattern search (shell script)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796657#M720645</link>
      <description>Okay, Harry it's for YOU !!!&lt;BR /&gt;     Can I list the files (using ls) and combing your regular expression but with not using grep? ls command should list only the files which ends with c or h or at. I do not want to use command like "ls *c *h *at". Here you can also use find command, which will be better.&lt;BR /&gt;     After the output of this command, I want to pass it to grep which will find the specific words in these files.&lt;BR /&gt;&lt;BR /&gt;-Sanjay</description>
      <pubDate>Thu, 29 Aug 2002 11:59:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796657#M720645</guid>
      <dc:creator>Sanjay Jadhav</dc:creator>
      <dc:date>2002-08-29T11:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: pattern search (shell script)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796658#M720646</link>
      <description>"Words" or "Sentences with words"?&lt;BR /&gt;&lt;BR /&gt;Words:&lt;BR /&gt;&lt;BR /&gt;perl -nle '$w{$1}++while/\b(\w+(?:a|t|ch))\b/g;END{print"$_ ($w{$_})"for sort keys%w}' file&lt;BR /&gt;&lt;BR /&gt;Sentences:&lt;BR /&gt;&lt;BR /&gt;perl -ne '/(a|t|ch)\b/ and print' file</description>
      <pubDate>Thu, 29 Aug 2002 12:03:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796658#M720646</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-08-29T12:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: pattern search (shell script)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796659#M720647</link>
      <description>&lt;BR /&gt;Yes,&lt;BR /&gt;&lt;BR /&gt;cd 2directory2search&lt;BR /&gt;&lt;BR /&gt;find . -type f -name "*[c|h]$" -o -name "*at$" -exec grep -l  WORDPATTERN_HERE {} \;&lt;BR /&gt;&lt;BR /&gt;example:&lt;BR /&gt;&lt;BR /&gt;cd 2directory2search&lt;BR /&gt;&lt;BR /&gt;find . -type f -name "*[c|h]$" -o -name "*at$" -exec grep -l "[Ss]anjay[ |$]" {} \;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Thu, 29 Aug 2002 12:08:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796659#M720647</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-08-29T12:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: pattern search (shell script)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796660#M720648</link>
      <description>&lt;BR /&gt;# cd 2directory2search&lt;BR /&gt;# perl -MFile::Find -nle&lt;BR /&gt;'find(sub{-f&amp;amp;&amp;amp;-s&amp;amp;&amp;amp;/(a|t|ch)$/ or return;local$/;open F,"&amp;lt;$_"or return;&lt;F&gt;=~/[Ss]anjay/ and print $File::Find::name},".")'&lt;/F&gt;</description>
      <pubDate>Thu, 29 Aug 2002 12:42:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796660#M720648</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-08-29T12:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: pattern search (shell script)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796661#M720649</link>
      <description>It appears that you want to search for words in a text file from all the C source and header files plus some at files (?) within a directory. Assuming c, h, and at are filename extensions and the text file, named tfile, contains fixed strings, try this:&lt;BR /&gt;&lt;BR /&gt;find . -type f -name '*.{c,h,at}' | xargs grep -Ff tfile&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Sep 2002 21:46:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pattern-search-shell-script/m-p/2796661#M720649</guid>
      <dc:creator>Jordan Bean</dc:creator>
      <dc:date>2002-09-03T21:46:31Z</dc:date>
    </item>
  </channel>
</rss>

