<?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: Problem in log generation in USS in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/problem-in-log-generation-in-uss/m-p/3983206#M93701</link>
    <description>Ok, thinking about it, you can of course send all of your output to a new file.  Then at the end, copy that output to your logfile, then to the tty.  Fortunately you have a nice function exit_process where you can do this clean up.&lt;BR /&gt;&lt;BR /&gt;(Add somewhere at the top)&lt;BR /&gt;TMP=/var/tmp/foo.log # add $$ if you have multiple occurrences&lt;BR /&gt;exec 3&amp;gt;&amp;amp;1  # save old stdout&lt;BR /&gt;exec 4&amp;gt;&amp;amp;2  # save old stderr, needed?&lt;BR /&gt;exec &amp;gt; $TMP 2&amp;gt;&amp;amp;1 # redirect both to $TMP&lt;BR /&gt;&lt;BR /&gt;And in exit_process:  (I'm sending to stdout vs /dev/tty, you can change that.)&lt;BR /&gt;&lt;BR /&gt;# Copy from $TMP to log and to stdout:&lt;BR /&gt;cat $TMP &amp;gt;&amp;gt; ../logs/build_bo_jar.log &lt;BR /&gt;cat $TMP 1&amp;gt;&amp;amp;3&lt;BR /&gt;rm -f $TMP</description>
    <pubDate>Wed, 27 Jun 2007 00:13:41 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2007-06-27T00:13:41Z</dc:date>
    <item>
      <title>Problem in log generation in USS</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-in-log-generation-in-uss/m-p/3983196#M93691</link>
      <description>When i am trying to run the same script on USS which i ran successfully on UNIX&lt;BR /&gt;I am getting an error.&lt;BR /&gt;&lt;BR /&gt;This is the part of the script which is giving an error. I want the output to be on the screen and also a log should be generated.&lt;BR /&gt;&lt;BR /&gt;tee ../logs/build_bo_jar.log &amp;gt;/dev/tty  |&amp;amp;&lt;BR /&gt;exec 2&amp;gt;&amp;amp;p 1&amp;gt;&amp;amp;2 &lt;BR /&gt;&lt;BR /&gt;Error is&lt;BR /&gt;exie 19: FSUM7341 bad file descriptor "p"&lt;BR /&gt;zOS 1.6 [/indus2/icapi/fw600/scripts]   &lt;BR /&gt;&lt;BR /&gt;Thanks in Adwance</description>
      <pubDate>Tue, 17 Apr 2007 13:21:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-in-log-generation-in-uss/m-p/3983196#M93691</guid>
      <dc:creator>Sandeep Dwivedi</dc:creator>
      <dc:date>2007-04-17T13:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in log generation in USS</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-in-log-generation-in-uss/m-p/3983197#M93692</link>
      <description>what is USS?</description>
      <pubDate>Tue, 17 Apr 2007 13:35:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-in-log-generation-in-uss/m-p/3983197#M93692</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-04-17T13:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in log generation in USS</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-in-log-generation-in-uss/m-p/3983198#M93693</link>
      <description>USS is unix system services. &lt;BR /&gt;UNIX System Services allows UNIX applications from other platforms to run on IBM mainframes.&lt;BR /&gt;USS is a certified UNIX implementation (XPG4 UNIX 95) optimized for mainframe architecture.&lt;BR /&gt;Through integration with the rest of z/OS, additional time share option (TSO) commands are available alongside the usual UNIX services, making it possible to process UNIX files using ISPF. Extensions in JCL make it possible to use these files in batch processing.&lt;BR /&gt;</description>
      <pubDate>Wed, 18 Apr 2007 11:14:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-in-log-generation-in-uss/m-p/3983198#M93693</guid>
      <dc:creator>Sandeep Dwivedi</dc:creator>
      <dc:date>2007-04-18T11:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in log generation in USS</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-in-log-generation-in-uss/m-p/3983199#M93694</link>
      <description>&amp;gt;USS is a certified UNIX implementation (XPG4 UNIX 95) &lt;BR /&gt;&lt;BR /&gt;I can't see &amp;amp;p (co-process) as being valid in UNIX95 through UNIX2003.  So it seems that USS doesn't have to support it.&lt;BR /&gt;&lt;BR /&gt;I would also think that would make |&amp;amp; useless.&lt;BR /&gt;(Right, I don't see it in UNIX2003.)</description>
      <pubDate>Wed, 18 Apr 2007 22:48:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-in-log-generation-in-uss/m-p/3983199#M93694</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-04-18T22:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in log generation in USS</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-in-log-generation-in-uss/m-p/3983200#M93695</link>
      <description>Thanks&lt;BR /&gt;is there any other way of generating a log in USS?</description>
      <pubDate>Sat, 21 Apr 2007 20:56:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-in-log-generation-in-uss/m-p/3983200#M93695</guid>
      <dc:creator>Sandeep Dwivedi</dc:creator>
      <dc:date>2007-04-21T20:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in log generation in USS</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-in-log-generation-in-uss/m-p/3983201#M93696</link>
      <description>This will generate the output on the screen as well as to a file (plus the error message, if any).&lt;BR /&gt;&lt;BR /&gt;cat ../logs/build_bo_jar.log  2&amp;gt;&amp;amp;1 |tee jarlog.log&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Sun, 22 Apr 2007 00:29:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-in-log-generation-in-uss/m-p/3983201#M93696</guid>
      <dc:creator>Rasheed Tamton</dc:creator>
      <dc:date>2007-04-22T00:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in log generation in USS</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-in-log-generation-in-uss/m-p/3983202#M93697</link>
      <description>&amp;gt;Rasheed: cat ../logs/build_bo_jar.log 2&amp;gt;&amp;amp;1 |tee jarlog.log&lt;BR /&gt;&lt;BR /&gt;Unfortunately I believe build_bo_jar.log IS the log file.  Of course that leads to a solution, output to the log file, then do a tail -f on that log file.  Or a cat(1) when done.</description>
      <pubDate>Sun, 22 Apr 2007 05:06:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-in-log-generation-in-uss/m-p/3983202#M93697</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-04-22T05:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in log generation in USS</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-in-log-generation-in-uss/m-p/3983203#M93698</link>
      <description>Rashid / Dennis&lt;BR /&gt;&lt;BR /&gt;Thanks for your advices. I tried them but&lt;BR /&gt;This solution is not working.&lt;BR /&gt;It is just creating build_bo_jar.log and jarlog.log of 0 size.&lt;BR /&gt;</description>
      <pubDate>Wed, 25 Apr 2007 16:40:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-in-log-generation-in-uss/m-p/3983203#M93698</guid>
      <dc:creator>Sandeep Dwivedi</dc:creator>
      <dc:date>2007-04-25T16:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in log generation in USS</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-in-log-generation-in-uss/m-p/3983204#M93699</link>
      <description>I'm lost, you'll need to show us what you are currently doing.  Perhaps a script fragment with some echos showing the output you want to track.</description>
      <pubDate>Wed, 25 Apr 2007 18:16:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-in-log-generation-in-uss/m-p/3983204#M93699</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-04-25T18:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in log generation in USS</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-in-log-generation-in-uss/m-p/3983205#M93700</link>
      <description>This is the script wch i am running in USS,&lt;BR /&gt;Since its an interactive script (accepts input from user) so the log generation become more complex.&lt;BR /&gt;I want to print output on the console as well as the same output should go inside a log file.&lt;BR /&gt;Please suggest me a method &lt;BR /&gt;_____________________&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;##############################################################################&lt;BR /&gt;#     Modification History&lt;BR /&gt;# 04/16/07 - Sandeep Dwivedi - Original Version&lt;BR /&gt;#&lt;BR /&gt;##############################################################################&lt;BR /&gt;&lt;BR /&gt;export JAVAPATH=/usr/lpp/zWebSphere/V6R1/java/J5.0/bin&lt;BR /&gt;export ICDIR=/myregion/icapi/fw600&lt;BR /&gt;export CLASSPATH=$ICDIR/bometa_class:$ICDIR/webapps/apifw/WEB-INF/lib/apifw.jar:$ICDIR/bometa_class/com/mycompany/apibo/metadata/$1&lt;BR /&gt;&lt;BR /&gt;clear&lt;BR /&gt;BONAME=$1&lt;BR /&gt;&lt;BR /&gt;#-----------------------------------------------------------------#&lt;BR /&gt;# Sub routines&lt;BR /&gt;#-----------------------------------------------------------------#&lt;BR /&gt;&lt;BR /&gt;exit_process()&lt;BR /&gt;{&lt;BR /&gt; echo "--------------------------------------------------------------------"&lt;BR /&gt; exit&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;#-----------------------------------------------------------------#&lt;BR /&gt;# Pre checks&lt;BR /&gt;#-----------------------------------------------------------------#&lt;BR /&gt;&lt;BR /&gt;# Check if no BOName was provided and also prompt for a BOName&lt;BR /&gt;if [ $# -lt 1 ] ; then &lt;BR /&gt;  echo "\nYou MUST include a BOName"&lt;BR /&gt;  echo "\nTo view valid BOName's, Press Enter"&lt;BR /&gt;  line&lt;BR /&gt;  ls -C $ICDIR/bometa_javasrc/com/mycompany/apibo/metadata/ &lt;BR /&gt;  echo "\nYou must not include more than One BOName. Please provide a BOName : "&lt;BR /&gt;  read BONAME&lt;BR /&gt;  BONCNT1=`echo $BONAME|wc -w`&lt;BR /&gt;  if [ $BONCNT1 -gt 1 ] ; then&lt;BR /&gt; echo "\nYou MUST not include more than one BOName\n" &lt;BR /&gt; exit_process&lt;BR /&gt;  fi&lt;BR /&gt;  if [ -z $BONAME ]   ; then&lt;BR /&gt; echo "\nYou MUST include a BOName\n" &lt;BR /&gt; exit_process&lt;BR /&gt;  fi&lt;BR /&gt;  echo "\nBONAME is $BONAME"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;# Check if more than one BOName's are entered&lt;BR /&gt;if [ $# -gt 1 ] ; then &lt;BR /&gt;  echo "\nYou MUST not include more than one BOName\n" &lt;BR /&gt;  exit_process&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;# Check whether the BOName is valid or not&lt;BR /&gt;echo "\nSearching for validity of BONAME in $ICDIR/bometa_javasrc/com/mycompany/apibo/metadata"&lt;BR /&gt;test -d $ICDIR/bometa_javasrc/com/mycompany/apibo/metadata/$BONAME&lt;BR /&gt;find_status=$?&lt;BR /&gt;if [ $find_status -gt 0 ] ; then &lt;BR /&gt;  echo "\nBOName not found, Please specify a VALID BOName\n" &lt;BR /&gt;  exit_process&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;#-----------------------------------------------------------------#&lt;BR /&gt;# Main Program&lt;BR /&gt;#-----------------------------------------------------------------#&lt;BR /&gt;&lt;BR /&gt;echo "Creating temporary directory temp$$"&lt;BR /&gt;mkdir $ICDIR/bometa_lib/temp$$&lt;BR /&gt;echo&lt;BR /&gt;&lt;BR /&gt;echo "Compiling $BONAME source into class files"&lt;BR /&gt;$JAVAPATH/javac -verbose -classpath $CLASSPATH -d $ICDIR/bometa_lib/temp$$ $ICDIR/bometa_javasrc/com/mycompany/apibo/metadata/$BONAME/*.java &lt;BR /&gt;echo&lt;BR /&gt;&lt;BR /&gt;echo "Copying $BONAME class files to the classes directory"&lt;BR /&gt;cp -r $ICDIR/bometa_lib/temp$$/* $ICDIR/bometa_class&lt;BR /&gt;echo&lt;BR /&gt;&lt;BR /&gt;cd $ICDIR/bometa_lib/temp$$&lt;BR /&gt;echo "Creating jar file $ICDIR/bometa_lib/ICBO-$BONAME.jar"&lt;BR /&gt;$JAVAPATH/jar -cvf $ICDIR/bometa_lib/ICBO-$BONAME.jar ./*&lt;BR /&gt;echo&lt;BR /&gt;&lt;BR /&gt;echo "Copying ICBO-$BONAME.jar to $ICDIR/webapps/apifw/WEB-INF/lib/ICBO-$BONAME.jar"&lt;BR /&gt;cp $ICDIR/bometa_lib/ICBO-$BONAME.jar $ICDIR/webapps/apifw/WEB-INF/lib/ICBO-$BONAME.jar&lt;BR /&gt;echo&lt;BR /&gt;&lt;BR /&gt;cd $ICDIR&lt;BR /&gt;echo "Removing temporary directory temp$$"&lt;BR /&gt;rm -r $ICDIR/bometa_lib/temp$$&lt;BR /&gt;echo&lt;BR /&gt;&lt;BR /&gt;exit_process&lt;BR /&gt;</description>
      <pubDate>Tue, 01 May 2007 12:31:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-in-log-generation-in-uss/m-p/3983205#M93700</guid>
      <dc:creator>Sandeep Dwivedi</dc:creator>
      <dc:date>2007-05-01T12:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in log generation in USS</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-in-log-generation-in-uss/m-p/3983206#M93701</link>
      <description>Ok, thinking about it, you can of course send all of your output to a new file.  Then at the end, copy that output to your logfile, then to the tty.  Fortunately you have a nice function exit_process where you can do this clean up.&lt;BR /&gt;&lt;BR /&gt;(Add somewhere at the top)&lt;BR /&gt;TMP=/var/tmp/foo.log # add $$ if you have multiple occurrences&lt;BR /&gt;exec 3&amp;gt;&amp;amp;1  # save old stdout&lt;BR /&gt;exec 4&amp;gt;&amp;amp;2  # save old stderr, needed?&lt;BR /&gt;exec &amp;gt; $TMP 2&amp;gt;&amp;amp;1 # redirect both to $TMP&lt;BR /&gt;&lt;BR /&gt;And in exit_process:  (I'm sending to stdout vs /dev/tty, you can change that.)&lt;BR /&gt;&lt;BR /&gt;# Copy from $TMP to log and to stdout:&lt;BR /&gt;cat $TMP &amp;gt;&amp;gt; ../logs/build_bo_jar.log &lt;BR /&gt;cat $TMP 1&amp;gt;&amp;amp;3&lt;BR /&gt;rm -f $TMP</description>
      <pubDate>Wed, 27 Jun 2007 00:13:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-in-log-generation-in-uss/m-p/3983206#M93701</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-06-27T00:13:41Z</dc:date>
    </item>
  </channel>
</rss>

