<?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 help! in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/5254677#M658772</link>
    <description>Hello,&lt;BR /&gt;&lt;BR /&gt;"I am able to do this by two separate invocations of curl but can this be done in a single invocation of curl without saving the output to a file?"&lt;BR /&gt;&lt;BR /&gt;You could use pipe (|) to avoid saving the output of the first curl to a file.&lt;BR /&gt;&lt;BR /&gt;Horia.</description>
    <pubDate>Wed, 08 Sep 2010 04:11:37 GMT</pubDate>
    <dc:creator>Horia Chirculescu</dc:creator>
    <dc:date>2010-09-08T04:11:37Z</dc:date>
    <item>
      <title>Script help!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/5254676#M658771</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I have the following curl command out of which I want to get two values in two separate variables -&lt;BR /&gt;&lt;BR /&gt;curl -w '\ntotal_time=%{time_total}s' -s  &lt;A href="http://zap.com:9999/cgi-bin/jboss/service.java/check?method=ping" target="_blank"&gt;http://zap.com:9999/cgi-bin/jboss/service.java/check?method=ping&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;THE OUTPUT - &lt;BR /&gt;&lt;BR /&gt;{&lt;BR /&gt;        "alive" = "ping";&lt;BR /&gt;        "exp" = "-1";&lt;BR /&gt;        "request" = {&lt;BR /&gt;                "method" = "ping";&lt;BR /&gt;        };&lt;BR /&gt;}&lt;BR /&gt;total_time=0.506s&lt;BR /&gt;&lt;BR /&gt;VAR1 - I want to capture the word "alive" and if its present in the output then print "OK" and if not present or timed out print "ERROR"&lt;BR /&gt;&lt;BR /&gt;VAR2 - I want to capture the string "total_time=0.506s" as is in variable 2.&lt;BR /&gt;&lt;BR /&gt;I am able to do this by two separate invocations of curl but can this be done in a single invocation of curl without saving the output to a file?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Allan.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Sep 2010 03:20:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/5254676#M658771</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2010-09-08T03:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: Script help!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/5254677#M658772</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;"I am able to do this by two separate invocations of curl but can this be done in a single invocation of curl without saving the output to a file?"&lt;BR /&gt;&lt;BR /&gt;You could use pipe (|) to avoid saving the output of the first curl to a file.&lt;BR /&gt;&lt;BR /&gt;Horia.</description>
      <pubDate>Wed, 08 Sep 2010 04:11:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/5254677#M658772</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2010-09-08T04:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: Script help!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/5254678#M658773</link>
      <description>Hi Allan:&lt;BR /&gt;&lt;BR /&gt;Perhaps:&lt;BR /&gt;&lt;BR /&gt;# curl -w ... | perl -n0e '$v1=/"alive"/?"OK":"ERROR";($v2)=/(total_time.+)/;print "$v1 $v2\n"'&lt;BR /&gt;&lt;BR /&gt;...which using your output would have produced:&lt;BR /&gt;&lt;BR /&gt;OK total_time=0.506s&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 08 Sep 2010 13:44:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/5254678#M658773</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-09-08T13:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: Script help!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/5254679#M658774</link>
      <description>thanks JRF!</description>
      <pubDate>Thu, 09 Sep 2010 21:20:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/5254679#M658774</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2010-09-09T21:20:29Z</dc:date>
    </item>
  </channel>
</rss>

