<?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: perl script and tee failure in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-and-tee-failure/m-p/3637439#M238612</link>
    <description>Hi Jerry:&lt;BR /&gt;&lt;BR /&gt;I believe the difference is in the 'Debug' value you have specified.  Non-zero values, cause all commands and responses to be sent to STDERR.  Thus, 'cron' would take this output and email it to you, but your script (without the redirection I suggested) would not have routed its output to your logfile.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Wed, 28 Sep 2005 17:46:40 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2005-09-28T17:46:40Z</dc:date>
    <item>
      <title>perl script and tee failure</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-and-tee-failure/m-p/3637433#M238606</link>
      <description>I have a ksh script that runs a perl script&lt;BR /&gt;ftp module in it.&lt;BR /&gt;&lt;BR /&gt;I am trying to use tee to get output from&lt;BR /&gt;perl script:&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;perlscript.pl | tee -a ./logfile.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The output does not go to logfile.&lt;BR /&gt;cron however does email me the perl output&lt;BR /&gt;I want. What's wrong with tee here?&lt;BR /&gt;&lt;BR /&gt;The perl script is using the perl Net::FTP&lt;BR /&gt;module if that makes any difference.</description>
      <pubDate>Wed, 28 Sep 2005 15:10:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-and-tee-failure/m-p/3637433#M238606</guid>
      <dc:creator>jerry1</dc:creator>
      <dc:date>2005-09-28T15:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: perl script and tee failure</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-and-tee-failure/m-p/3637434#M238607</link>
      <description>Hi Jerry:&lt;BR /&gt;&lt;BR /&gt;The output you see is probably going to STDERR.  Do this:&lt;BR /&gt;&lt;BR /&gt;# script &amp;gt;2&amp;amp;1 | tee logfile&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 28 Sep 2005 15:15:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-and-tee-failure/m-p/3637434#M238607</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-09-28T15:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: perl script and tee failure</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-and-tee-failure/m-p/3637435#M238608</link>
      <description>Of course he means:&lt;BR /&gt;&lt;BR /&gt;# script 2&amp;gt;&amp;amp;1 | tee logfile&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Wed, 28 Sep 2005 15:23:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-and-tee-failure/m-p/3637435#M238608</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2005-09-28T15:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: perl script and tee failure</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-and-tee-failure/m-p/3637436#M238609</link>
      <description>Hi Merijn:&lt;BR /&gt;&lt;BR /&gt;YES! I (of course) do mean that!&lt;BR /&gt;&lt;BR /&gt;# script 2&amp;gt;&amp;amp;1 | tee logfile&lt;BR /&gt;&lt;BR /&gt;Thanks (and warm regards)!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 28 Sep 2005 15:30:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-and-tee-failure/m-p/3637436#M238609</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-09-28T15:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: perl script and tee failure</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-and-tee-failure/m-p/3637437#M238610</link>
      <description>I just ran a Perl script under ksh using Net::FTP and piped to tee -a xxx and the output was sent to stdout and to the file xxx just as expected. Is your Perl script interactive? If so there may be a problem with the redirection of stdin. My particular Perl script just processed command-line args and worked perfectly. One other thought is that your Perl script might itself be redirecting stdout so that tee sees nothing on its stdin.</description>
      <pubDate>Wed, 28 Sep 2005 15:31:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-and-tee-failure/m-p/3637437#M238610</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-09-28T15:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: perl script and tee failure</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-and-tee-failure/m-p/3637438#M238611</link>
      <description>I don't know why but 2&amp;gt;&amp;amp;1 works.&lt;BR /&gt;I get stderr to console and logfile. ???&lt;BR /&gt;&lt;BR /&gt;Why does Clays work okay.??&lt;BR /&gt;&lt;BR /&gt;Here is the ksh script.&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;&lt;BR /&gt;test.pl  |  tee -a a.out&lt;BR /&gt;&lt;BR /&gt;Here is the perl code.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/perl &lt;BR /&gt;&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;use Net::FTP;&lt;BR /&gt;use Net::Netrc;&lt;BR /&gt;my $server="appsvr2";&lt;BR /&gt;my $file="testfile";&lt;BR /&gt;my $destination = "/tmp";&lt;BR /&gt;my $pageid = "sysadmins";&lt;BR /&gt;my $pager = "/usr/local/bin/pager";&lt;BR /&gt;my $ftpid = "user1";&lt;BR /&gt;my $pass = "pass12";&lt;BR /&gt;&lt;BR /&gt;my $ftp = Net::FTP-&amp;gt;new ($server, Timeout =&amp;gt; 9000, Debug =&amp;gt; 3) or die (exec "$pager $pageid \"$server: ftp AP cannot connect: $@\"") ; &lt;BR /&gt;&lt;BR /&gt;$ftp-&amp;gt;login("$ftpid","$pass") or die (exec "$pager $pageid \"ftp AP cannot login.\"") ; &lt;BR /&gt;&lt;BR /&gt;$ftp-&amp;gt;binary or die (exec "$pager $pageid \"ftp AP failed binary mode.\"") ;&lt;BR /&gt;&lt;BR /&gt;#$ftp-&amp;gt;cwd ($destination) or die (exec "$pager $pageid \"ftp AP failed cwd.\"") ;&lt;BR /&gt;&lt;BR /&gt;$ftp-&amp;gt;put ($file) or die (exec "$pager $pageid \"ftp AP cannot put file.  \"") ;&lt;BR /&gt;&lt;BR /&gt;$ftp-&amp;gt;ls ($file) or die (exec "$pager $pageid \"ls of AP file failed.  \"") ;&lt;BR /&gt;&lt;BR /&gt;$ftp-&amp;gt;quit;&lt;BR /&gt;&lt;BR /&gt;# If we get this far then everything should be okay. Send notice to requestor.&lt;BR /&gt;&lt;BR /&gt;my $uid=(stat ("testfile"))[4];&lt;BR /&gt;my $name=getpwuid ($uid);&lt;BR /&gt;open OU,"|mailx -s \"AP file sent\" $name";&lt;BR /&gt;open IN,"/tmp/runap.data";&lt;BR /&gt;print OU $_ while &lt;IN&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/IN&gt;</description>
      <pubDate>Wed, 28 Sep 2005 16:21:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-and-tee-failure/m-p/3637438#M238611</guid>
      <dc:creator>jerry1</dc:creator>
      <dc:date>2005-09-28T16:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: perl script and tee failure</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-and-tee-failure/m-p/3637439#M238612</link>
      <description>Hi Jerry:&lt;BR /&gt;&lt;BR /&gt;I believe the difference is in the 'Debug' value you have specified.  Non-zero values, cause all commands and responses to be sent to STDERR.  Thus, 'cron' would take this output and email it to you, but your script (without the redirection I suggested) would not have routed its output to your logfile.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 28 Sep 2005 17:46:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-and-tee-failure/m-p/3637439#M238612</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-09-28T17:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: perl script and tee failure</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-and-tee-failure/m-p/3637440#M238613</link>
      <description>Actually the answer is even simpler. After examining your Perl script, you don't have any statements which output to stdout and thus tee see's no input. The only output which MIGHT go to your terminal is stderr and tee doesn't read that. Only when both stderr and stdout are sent to fdes 1 (stdout) does tee see any input. This was a simple case of that stupid computer doing exactly what it was told to do.</description>
      <pubDate>Wed, 28 Sep 2005 20:25:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-and-tee-failure/m-p/3637440#M238613</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-09-28T20:25:13Z</dc:date>
    </item>
  </channel>
</rss>

