<?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 debug output in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-debug-output/m-p/4456567#M359508</link>
    <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; The script is called by some real time application and there is some issue with it. So we want to trace the script using set -x and capture the output in temporary file.&lt;BR /&gt;&lt;BR /&gt;The at the top of the script add the two lines shown below ('exec' and 'set'):&lt;BR /&gt;&lt;BR /&gt;# cat ./thescript&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;exec 2&amp;gt;/var/tmp/errlog.$$&lt;BR /&gt;set  -x&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Your script will write it's trace to '/var/tmp/errlog' with the PID of the process appended for multiple runs or instances.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Thu, 09 Jul 2009 12:06:40 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2009-07-09T12:06:40Z</dc:date>
    <item>
      <title>Script debug output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-debug-output/m-p/4456564#M359505</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I  have a script which generates error. I need to capture the output or the error in a debug mode using set -x. How to capture the error in a file in debug mode using set -x&lt;BR /&gt;&lt;BR /&gt;Thanks &amp;amp; Regards</description>
      <pubDate>Thu, 09 Jul 2009 11:48:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-debug-output/m-p/4456564#M359505</guid>
      <dc:creator>sa2009</dc:creator>
      <dc:date>2009-07-09T11:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Script debug output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-debug-output/m-p/4456565#M359506</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Simply redirect STDERR to your file:&lt;BR /&gt;&lt;BR /&gt;# sh -x ./myscript 2&amp;gt;mytrace&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Thu, 09 Jul 2009 11:55:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-debug-output/m-p/4456565#M359506</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-07-09T11:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: Script debug output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-debug-output/m-p/4456566#M359507</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;Thanks for your reply. The script is called by some real time application and there is some issue with it. So we want to trace the script using set -x and capture the output in temporary file.&lt;BR /&gt;&lt;BR /&gt;Please suggest.&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Thu, 09 Jul 2009 11:57:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-debug-output/m-p/4456566#M359507</guid>
      <dc:creator>sa2009</dc:creator>
      <dc:date>2009-07-09T11:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: Script debug output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-debug-output/m-p/4456567#M359508</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; The script is called by some real time application and there is some issue with it. So we want to trace the script using set -x and capture the output in temporary file.&lt;BR /&gt;&lt;BR /&gt;The at the top of the script add the two lines shown below ('exec' and 'set'):&lt;BR /&gt;&lt;BR /&gt;# cat ./thescript&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;exec 2&amp;gt;/var/tmp/errlog.$$&lt;BR /&gt;set  -x&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Your script will write it's trace to '/var/tmp/errlog' with the PID of the process appended for multiple runs or instances.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 09 Jul 2009 12:06:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-debug-output/m-p/4456567#M359508</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-07-09T12:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: Script debug output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-debug-output/m-p/4456568#M359509</link>
      <description>will it be stderr(2) or the stdout(1) that will give the relevant data.. please confirm.&lt;BR /&gt;&lt;BR /&gt;Also, do we have to type in "set +x" at the end of the script.</description>
      <pubDate>Thu, 09 Jul 2009 12:43:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-debug-output/m-p/4456568#M359509</guid>
      <dc:creator>sa2009</dc:creator>
      <dc:date>2009-07-09T12:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: Script debug output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-debug-output/m-p/4456569#M359510</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; will it be stderr(2) or the stdout(1) that will give the relevant data.. please confirm.&lt;BR /&gt;&lt;BR /&gt;As I showed, if you want to capture the trace in a file, you need to redirect STDERR to that file.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Also, do we have to type in "set +x" at the end of the script.&lt;BR /&gt;&lt;BR /&gt;No, when your script exits, the setting ceases to matter.  If you only want some particular section of your code traced, then you can bound it by 'set -x' and 'set +x' accordingly.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Thu, 09 Jul 2009 12:52:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-debug-output/m-p/4456569#M359510</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-07-09T12:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Script debug output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-debug-output/m-p/4456570#M359511</link>
      <description>Thank You James. I appreciate your assistance in this issue.</description>
      <pubDate>Thu, 09 Jul 2009 13:35:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-debug-output/m-p/4456570#M359511</guid>
      <dc:creator>sa2009</dc:creator>
      <dc:date>2009-07-09T13:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Script debug output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-debug-output/m-p/4456571#M359512</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Thank You James. I appreciate your assistance in this issue.&lt;BR /&gt;&lt;BR /&gt;If you are satistied with the answers you have received, please read:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/service/forums/helptips.do?#28" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/helptips.do?#28&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Assigning points is both a way of saying "thank you" and a way of showing future readers of your thread what helped you solve your problem.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 09 Jul 2009 13:37:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-debug-output/m-p/4456571#M359512</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-07-09T13:37:38Z</dc:date>
    </item>
  </channel>
</rss>

