<?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: fbackup returncode with  a pipe in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540474#M858461</link>
    <description>Hi James,&lt;BR /&gt;&lt;BR /&gt;the "tee" in the 1st line, "tee's" only the results of the "echo $? &amp;gt; file". So the result of "tee -ia file" is an emty file.&lt;BR /&gt;Do you have any alternatives.&lt;BR /&gt;&lt;BR /&gt;Thanks, Wessel&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 14 Jun 2001 13:19:51 GMT</pubDate>
    <dc:creator>Wessel Baptist</dc:creator>
    <dc:date>2001-06-14T13:19:51Z</dc:date>
    <item>
      <title>fbackup returncode with  a pipe</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540469#M858456</link>
      <description>When I submit "commandA pipe commandB" are there any possibilities to see the returncode of commandA?&lt;BR /&gt;What am I doing?&lt;BR /&gt;fbackup &lt;ANY options=""&gt; -v | tee logfile&lt;BR /&gt;After completion of fbackup I want to know the returncode of fbackup.&lt;BR /&gt;&lt;BR /&gt;Thanks so far.&lt;BR /&gt;Wessel&lt;/ANY&gt;</description>
      <pubDate>Thu, 14 Jun 2001 08:15:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540469#M858456</guid>
      <dc:creator>Wessel Baptist</dc:creator>
      <dc:date>2001-06-14T08:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: fbackup returncode with  a pipe</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540470#M858457</link>
      <description>&lt;BR /&gt;Instead of doing fbackup | tee &lt;LOGFILE&gt;&lt;BR /&gt;you can do;&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;exec 1&amp;gt; &lt;LOGFILE&gt; 2&amp;gt;&amp;amp;1&lt;BR /&gt;fbackup ....&lt;BR /&gt;echo $?&lt;BR /&gt;&lt;BR /&gt;Now you can still get full log output to logfile and still pick up and process the return code from fbackup.&lt;BR /&gt;&lt;/LOGFILE&gt;&lt;/LOGFILE&gt;</description>
      <pubDate>Thu, 14 Jun 2001 08:31:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540470#M858457</guid>
      <dc:creator>Stefan Farrelly</dc:creator>
      <dc:date>2001-06-14T08:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: fbackup returncode with  a pipe</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540471#M858458</link>
      <description>echo $?&lt;BR /&gt;I'll do a script like this:&lt;BR /&gt;&lt;BR /&gt;exec 1 &amp;gt; /tmp/logfile 2&amp;gt;&amp;amp;1&lt;BR /&gt;fbackup ....................&lt;BR /&gt;echo $?&lt;BR /&gt;</description>
      <pubDate>Thu, 14 Jun 2001 08:50:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540471#M858458</guid>
      <dc:creator>federico_3</dc:creator>
      <dc:date>2001-06-14T08:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: fbackup returncode with  a pipe</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540472#M858459</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;this is not what I'm looking for.&lt;BR /&gt;I like to the output of fbackup on screen, so I can see the progress of fbackup, therefore I use -v switch and at the same time I want to log every fbackup-message.&lt;BR /&gt;And after fbackup has finished I want to test the returncode of fbackup.&lt;BR /&gt;If returncode is not equal to zero I want to look in the logfile for "serious" messages.</description>
      <pubDate>Thu, 14 Jun 2001 10:42:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540472#M858459</guid>
      <dc:creator>Wessel Baptist</dc:creator>
      <dc:date>2001-06-14T10:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: fbackup returncode with  a pipe</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540473#M858460</link>
      <description>Hi Wessel:&lt;BR /&gt;&lt;BR /&gt;You CAN achieve exactly what you are seeking by using the scheme below.  For simplicity, I have placed elipses ("...") in place of the options to 'fbackup':&lt;BR /&gt;&lt;BR /&gt;# ( fbackup ... 2&amp;gt;&amp;amp;1 ; echo $? &amp;gt; /tmp/fb.xit ) | tee -ia /tmp/fb.log&lt;BR /&gt;&lt;BR /&gt;# EXITV=`&amp;lt; /tmp/fb.xit`&lt;BR /&gt;&lt;BR /&gt;# if [ $EXITV -eq 0 ]...&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 14 Jun 2001 11:03:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540473#M858460</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-06-14T11:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: fbackup returncode with  a pipe</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540474#M858461</link>
      <description>Hi James,&lt;BR /&gt;&lt;BR /&gt;the "tee" in the 1st line, "tee's" only the results of the "echo $? &amp;gt; file". So the result of "tee -ia file" is an emty file.&lt;BR /&gt;Do you have any alternatives.&lt;BR /&gt;&lt;BR /&gt;Thanks, Wessel&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 14 Jun 2001 13:19:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540474#M858461</guid>
      <dc:creator>Wessel Baptist</dc:creator>
      <dc:date>2001-06-14T13:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: fbackup returncode with  a pipe</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540475#M858462</link>
      <description>Hi Wessel:&lt;BR /&gt;&lt;BR /&gt;Sorry, I lifted some of my code out of context.  Try this:&lt;BR /&gt;&lt;BR /&gt;# ( fbackup ... 2&amp;gt;&amp;amp;1 ; echo $? &amp;gt; /tmp/fb.xit ) | tee -ia /tmp/fb.log &lt;BR /&gt;&lt;BR /&gt;# EXITV=`cat /tmp/fb.xit` &lt;BR /&gt;&lt;BR /&gt;# if [ $EXITV -eq 0 ]... &lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 14 Jun 2001 14:03:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540475#M858462</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-06-14T14:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: fbackup returncode with  a pipe</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540476#M858463</link>
      <description>Hi Wessel,&lt;BR /&gt;&lt;BR /&gt;Here's some sample perl code that can be used to send output from within a script to multiple file handles:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/perl -w&lt;BR /&gt;&lt;BR /&gt;# save the old file handle for STDERR&lt;BR /&gt;open(OLDERR, "&amp;gt;&amp;amp;STDERR");&lt;BR /&gt;&lt;BR /&gt;# create some new ones to send output to&lt;BR /&gt;# screen and log file&lt;BR /&gt;open(OUTFILE, "| tee fbackup.log");&lt;BR /&gt;open(STDERR, "&amp;gt;&amp;amp;OUTFILE");&lt;BR /&gt;select(OUTFILE);&lt;BR /&gt;&lt;BR /&gt;# send output to tee pipe&lt;BR /&gt;$result=system("fbackup ...");&lt;BR /&gt;&lt;BR /&gt;# close output to tee pipe&lt;BR /&gt;close(STDERR);&lt;BR /&gt;close(OUTFILE);&lt;BR /&gt;&lt;BR /&gt;# send output to STDOUT&lt;BR /&gt;select(STDOUT);&lt;BR /&gt;# re-attach STDERR&lt;BR /&gt;open(STDERR, "&amp;gt;&amp;amp;OLDERR");&lt;BR /&gt;&lt;BR /&gt;if(!$result) {&lt;BR /&gt;&lt;BR /&gt;... your code here ...&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Hope this works :-)&lt;BR /&gt;&lt;BR /&gt;Vincent&lt;BR /&gt;</description>
      <pubDate>Fri, 15 Jun 2001 08:42:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540476#M858463</guid>
      <dc:creator>Vincent Stedema</dc:creator>
      <dc:date>2001-06-15T08:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: fbackup returncode with  a pipe</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540477#M858464</link>
      <description>Hi Vincent,&lt;BR /&gt;&lt;BR /&gt;I found perl in /usr/contrib/bin and I've tried your script and this works. Now I have the same output on screen as wel as in a file. Thanks a lot.&lt;BR /&gt;B.t.w. where can I find information / manuals over perl. I don't know anything about perl.</description>
      <pubDate>Mon, 18 Jun 2001 12:46:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540477#M858464</guid>
      <dc:creator>Wessel Baptist</dc:creator>
      <dc:date>2001-06-18T12:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: fbackup returncode with  a pipe</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540478#M858465</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;The No. 1 resource is &lt;A href="http://www.cpan.org" target="_blank"&gt;http://www.cpan.org&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;AFAIK, the perl version shipped with HP-UX 11.00 is 4.??, which is not as powerful as the more recent versions (5.*). You'll find a depot for a more recent version at &lt;A href="http://hpux.tn.tudelft.nl/hppd/hpux/Languages/perl-5.6.1/" target="_blank"&gt;http://hpux.tn.tudelft.nl/hppd/hpux/Languages/perl-5.6.1/&lt;/A&gt; .&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Vincent&lt;BR /&gt;</description>
      <pubDate>Mon, 18 Jun 2001 13:09:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540478#M858465</guid>
      <dc:creator>Vincent Stedema</dc:creator>
      <dc:date>2001-06-18T13:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: fbackup returncode with  a pipe</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540479#M858466</link>
      <description>I took another look and the solution of James R. Ferguson is exactly what I needed.&lt;BR /&gt;Thanks&lt;BR /&gt;Wessel</description>
      <pubDate>Thu, 06 Sep 2001 13:33:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540479#M858466</guid>
      <dc:creator>Wessel Baptist</dc:creator>
      <dc:date>2001-09-06T13:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: fbackup returncode with  a pipe</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540480#M858467</link>
      <description>Hi Wessel:&lt;BR /&gt;&lt;BR /&gt;Thank you very much!  And, thanks for taking the time to track this thread down to say so.  You make it all worthwhile.&lt;BR /&gt;&lt;BR /&gt;With my warmest regards, Jim.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 06 Sep 2001 13:39:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/fbackup-returncode-with-a-pipe/m-p/2540480#M858467</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-09-06T13:39:15Z</dc:date>
    </item>
  </channel>
</rss>

