<?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 not working in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-not-working/m-p/3470440#M211689</link>
    <description>set -x &lt;BR /&gt;&lt;BR /&gt;and rerun it&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry d brown jr</description>
    <pubDate>Tue, 25 Jan 2005 07:52:29 GMT</pubDate>
    <dc:creator>harry d brown jr</dc:creator>
    <dc:date>2005-01-25T07:52:29Z</dc:date>
    <item>
      <title>script not working</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-not-working/m-p/3470439#M211688</link>
      <description>I have written one script to do some omniback reporting but the script is not running at all no error message and I have to ctrl-c to break it.</description>
      <pubDate>Tue, 25 Jan 2005 07:40:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-not-working/m-p/3470439#M211688</guid>
      <dc:creator>kholikt</dc:creator>
      <dc:date>2005-01-25T07:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: script not working</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-not-working/m-p/3470440#M211689</link>
      <description>set -x &lt;BR /&gt;&lt;BR /&gt;and rerun it&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry d brown jr</description>
      <pubDate>Tue, 25 Jan 2005 07:52:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-not-working/m-p/3470440#M211689</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2005-01-25T07:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: script not working</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-not-working/m-p/3470441#M211690</link>
      <description>You'll need to trace the execution to find out where the hang occurs, probably in one of the omniback commands. I would suspect any media query commands. But to be sure, add the -x option to all program parts including functions. The way I do this is to add a debug test to the beginning of every function and also to the beginning of the main program:&lt;BR /&gt; &lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;# To trace this script's operation, set the variable&lt;BR /&gt;# DEBUG temporarily as in:&lt;BR /&gt;#     DEBUG=1 my_script options...&lt;BR /&gt;DEBUG=${DEBUG:=NotSet}&lt;BR /&gt;[[ $DEBUG = NotSet ]] || set -x&lt;BR /&gt; &lt;BR /&gt;...&lt;BR /&gt; &lt;BR /&gt;function MyFunction&lt;BR /&gt;{&lt;BR /&gt;DEBUG=${DEBUG:=NotSet}&lt;BR /&gt;[[ $DEBUG = NotSet ]] || set -x&lt;BR /&gt; &lt;BR /&gt;...&lt;BR /&gt; &lt;BR /&gt;}&lt;BR /&gt; &lt;BR /&gt;etc...&lt;BR /&gt;&lt;BR /&gt;Repeat the $DEBUG test in every function (in yours: getinfo_std getinfo_lib standalone library). When you run the script normally, the debug statements are inactive. When you run with the temprary variable DEBUG set on the command line (don't set or export DEBUG on a separate line) the script will trace every step onto stderr. If you want to pipe the results to pg or more, be sure to redirect stderr to stdout as in:&lt;BR /&gt; &lt;BR /&gt;DEBUG=1 my_script options 2&amp;gt;&amp;amp;1 | more&lt;BR /&gt; &lt;BR /&gt;For readability, you may want to change all your grave accent (reverse apostrophes) to $(...) as the grave accent construct has been deprecated for many years (see man sh-posix or man ksh). Example:&lt;BR /&gt; &lt;BR /&gt;change: HOST=`hostname`&lt;BR /&gt;to: HOST=$(hostname)&lt;BR /&gt; &lt;BR /&gt;Grave accents cannot be nested as in:&lt;BR /&gt; &lt;BR /&gt;MYIP=$(getip $(hostname))</description>
      <pubDate>Tue, 25 Jan 2005 08:03:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-not-working/m-p/3470441#M211690</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-01-25T08:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: script not working</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-not-working/m-p/3470442#M211691</link>
      <description>Hi,&lt;BR /&gt;depending on the size/complexity of the script either add debug statements (echo "this is proces...") and/or set +x&lt;BR /&gt;set +x output can be a bit confusing, especially in loops.&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Jan 2005 08:27:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-not-working/m-p/3470442#M211691</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-01-25T08:27:04Z</dc:date>
    </item>
  </channel>
</rss>

