<?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 simple grep query in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-grep-query/m-p/3595662#M232053</link>
    <description>Hi there&lt;BR /&gt;&lt;BR /&gt;I've got two processes running both concerning TSM.&lt;BR /&gt;&lt;BR /&gt;One process is &lt;BR /&gt;&lt;BR /&gt;    root 659500      1   0   Aug 01      -  0:00 /usr/tivoli/tsm/client/ba/bin/d&lt;BR /&gt;smcad -optfile=/file1&lt;BR /&gt;&lt;BR /&gt;The other is &lt;BR /&gt;&lt;BR /&gt;    root 659500      1   0   Aug 01      -  0:00 /usr/tivoli/tsm/client/ba/bin/d&lt;BR /&gt;smcad.shared -optfile=/file1&lt;BR /&gt;&lt;BR /&gt;I want to be able to grep for 'dsmcad' for the first one, or 'dsmcad.' for the second one&lt;BR /&gt;&lt;BR /&gt;i.e. How to run grep and have them pick up ONE of the entries only&lt;BR /&gt;&lt;BR /&gt;ps -ef | grep "dsmcad." picks up both&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;&lt;BR /&gt;Russ</description>
    <pubDate>Wed, 03 Aug 2005 07:57:20 GMT</pubDate>
    <dc:creator>HP System Handle Owner</dc:creator>
    <dc:date>2005-08-03T07:57:20Z</dc:date>
    <item>
      <title>simple grep query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-grep-query/m-p/3595662#M232053</link>
      <description>Hi there&lt;BR /&gt;&lt;BR /&gt;I've got two processes running both concerning TSM.&lt;BR /&gt;&lt;BR /&gt;One process is &lt;BR /&gt;&lt;BR /&gt;    root 659500      1   0   Aug 01      -  0:00 /usr/tivoli/tsm/client/ba/bin/d&lt;BR /&gt;smcad -optfile=/file1&lt;BR /&gt;&lt;BR /&gt;The other is &lt;BR /&gt;&lt;BR /&gt;    root 659500      1   0   Aug 01      -  0:00 /usr/tivoli/tsm/client/ba/bin/d&lt;BR /&gt;smcad.shared -optfile=/file1&lt;BR /&gt;&lt;BR /&gt;I want to be able to grep for 'dsmcad' for the first one, or 'dsmcad.' for the second one&lt;BR /&gt;&lt;BR /&gt;i.e. How to run grep and have them pick up ONE of the entries only&lt;BR /&gt;&lt;BR /&gt;ps -ef | grep "dsmcad." picks up both&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;&lt;BR /&gt;Russ</description>
      <pubDate>Wed, 03 Aug 2005 07:57:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-grep-query/m-p/3595662#M232053</guid>
      <dc:creator>HP System Handle Owner</dc:creator>
      <dc:date>2005-08-03T07:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: simple grep query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-grep-query/m-p/3595663#M232054</link>
      <description>Try&lt;BR /&gt; &lt;BR /&gt;UNIX95= ps -o pid= -C dsmcad&lt;BR /&gt; &lt;BR /&gt;or &lt;BR /&gt; &lt;BR /&gt;UNIX95= ps -o pid= -C dsmcad.shared</description>
      <pubDate>Wed, 03 Aug 2005 08:05:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-grep-query/m-p/3595663#M232054</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2005-08-03T08:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: simple grep query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-grep-query/m-p/3595664#M232055</link>
      <description>Use&lt;BR /&gt;&lt;BR /&gt;ps -ef | grep "dsmcad\."&lt;BR /&gt;&lt;BR /&gt;You need to escape the "." since in regular expressions . means "any single character" so it is matchnig the space in the "smcad " line.  The escape means look literally for the "."</description>
      <pubDate>Wed, 03 Aug 2005 08:07:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-grep-query/m-p/3595664#M232055</guid>
      <dc:creator>Simon Hargrave</dc:creator>
      <dc:date>2005-08-03T08:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: simple grep query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-grep-query/m-p/3595665#M232056</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;ps -ef | grep 'dsmcad[^.]'&lt;BR /&gt;will match the first&lt;BR /&gt;and&lt;BR /&gt;ps -ef | grep 'dsmcad\.' &lt;BR /&gt;will match the second&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Aug 2005 08:08:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-grep-query/m-p/3595665#M232056</guid>
      <dc:creator>Andrew Merritt_2</dc:creator>
      <dc:date>2005-08-03T08:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: simple grep query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-grep-query/m-p/3595666#M232057</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Try:&lt;BR /&gt;&lt;BR /&gt;ps -ef|grep "dsmcad " don't forget the blank space .-)&lt;BR /&gt;&lt;BR /&gt;and&lt;BR /&gt;&lt;BR /&gt;ps -ef|grep "dmscad."&lt;BR /&gt;&lt;BR /&gt;Enjoy :)&lt;BR /&gt;&lt;BR /&gt;Pedro</description>
      <pubDate>Wed, 03 Aug 2005 08:12:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-grep-query/m-p/3595666#M232057</guid>
      <dc:creator>Pedro Cirne</dc:creator>
      <dc:date>2005-08-03T08:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: simple grep query</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-grep-query/m-p/3595667#M232058</link>
      <description>As you have seen, grep is a very poor tool to use with ps, especially because ps has exact match capability built-in. You use the -C option for an exact match to the process name. But the -C option (and -H and -o, etc) are not available unless you enable (temporarily) the XPG4 behavior using UNIX95. This will give an exact match for either process:&lt;BR /&gt; &lt;BR /&gt;UNIX95= ps -fC dsmcad&lt;BR /&gt;UNIX95= ps -fC dsmcad.shared&lt;BR /&gt; &lt;BR /&gt;Although the UNIX95= looks strange, this is how you define a temporary variable for the name process. Don't set or export UNIX95 in your shell, just use it on the command line as shown.</description>
      <pubDate>Wed, 03 Aug 2005 11:15:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-grep-query/m-p/3595667#M232058</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-08-03T11:15:42Z</dc:date>
    </item>
  </channel>
</rss>

