<?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 conditional grep thru ftp in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/conditional-grep-thru-ftp/m-p/4292061#M672680</link>
    <description>Hi,&lt;BR /&gt; I'm trying to grep for a process &amp;amp; if it exists, tail a file. This needs to be done thru a ftp script&lt;BR /&gt;&lt;BR /&gt;Checks for the process &lt;BR /&gt;sndline "ps -eaf | grep process | grep -v grep"&lt;BR /&gt;receive "&amp;gt;"&lt;BR /&gt;&lt;BR /&gt;I know if I was in a script, I could&lt;BR /&gt;ps -eaf | grep process | grep -v grep&lt;BR /&gt;if [ $? -eq 0 ]&lt;BR /&gt; then&lt;BR /&gt;    tail afiles&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;How do I put the 2 together?&lt;BR /&gt; thanks</description>
    <pubDate>Wed, 22 Oct 2008 11:36:31 GMT</pubDate>
    <dc:creator>Renda Skandier</dc:creator>
    <dc:date>2008-10-22T11:36:31Z</dc:date>
    <item>
      <title>conditional grep thru ftp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/conditional-grep-thru-ftp/m-p/4292061#M672680</link>
      <description>Hi,&lt;BR /&gt; I'm trying to grep for a process &amp;amp; if it exists, tail a file. This needs to be done thru a ftp script&lt;BR /&gt;&lt;BR /&gt;Checks for the process &lt;BR /&gt;sndline "ps -eaf | grep process | grep -v grep"&lt;BR /&gt;receive "&amp;gt;"&lt;BR /&gt;&lt;BR /&gt;I know if I was in a script, I could&lt;BR /&gt;ps -eaf | grep process | grep -v grep&lt;BR /&gt;if [ $? -eq 0 ]&lt;BR /&gt; then&lt;BR /&gt;    tail afiles&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;How do I put the 2 together?&lt;BR /&gt; thanks</description>
      <pubDate>Wed, 22 Oct 2008 11:36:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/conditional-grep-thru-ftp/m-p/4292061#M672680</guid>
      <dc:creator>Renda Skandier</dc:creator>
      <dc:date>2008-10-22T11:36:31Z</dc:date>
    </item>
    <item>
      <title>Re: conditional grep thru ftp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/conditional-grep-thru-ftp/m-p/4292062#M672681</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;grep command is not available in an ftp session.&lt;BR /&gt;&lt;BR /&gt;You must use grep to create a file and then a second process to ftp it where you want it to go.&lt;BR /&gt;&lt;BR /&gt;You can in your second loop integrate an ftp scrip loop.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Wed, 22 Oct 2008 11:49:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/conditional-grep-thru-ftp/m-p/4292062#M672681</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2008-10-22T11:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: conditional grep thru ftp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/conditional-grep-thru-ftp/m-p/4292063#M672682</link>
      <description>ftp is the wrong term :(&lt;BR /&gt;I'm actually using a tcp connection to various addresses and check for a hung process&lt;BR /&gt;&lt;BR /&gt;sndline "ps -eaf | grep process| grep -v grep"&lt;BR /&gt;receive "&amp;gt;"&lt;BR /&gt;&lt;BR /&gt;works and displays to my screen.  If the process exists, I'd like to tail a file&lt;BR /&gt;&lt;BR /&gt;thanks</description>
      <pubDate>Wed, 22 Oct 2008 12:03:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/conditional-grep-thru-ftp/m-p/4292063#M672682</guid>
      <dc:creator>Renda Skandier</dc:creator>
      <dc:date>2008-10-22T12:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: conditional grep thru ftp</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/conditional-grep-thru-ftp/m-p/4292064#M672683</link>
      <description>Hi :&lt;BR /&gt;&lt;BR /&gt;I suppose you could get there from here in a round-about fashion.&lt;BR /&gt;&lt;BR /&gt;You could execute an FTP script and within the FTP session do:&lt;BR /&gt;&lt;BR /&gt;!ps -ef ...&lt;BR /&gt;&lt;BR /&gt;You would want to collect the FTP session in a file that you can parse.  Use the '-v' option to FTP and redirect like:&lt;BR /&gt;&lt;BR /&gt;ftp -in -v  &amp;gt;&amp;gt; /var/tmp/ftp.$$ 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;Once you have run the *first* ftp, examine the log you created and based on its contents execute a second FTP to do whatever you want.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Wed, 22 Oct 2008 12:10:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/conditional-grep-thru-ftp/m-p/4292064#M672683</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-10-22T12:10:31Z</dc:date>
    </item>
  </channel>
</rss>

