<?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 hangs on error in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-hangs-on-error/m-p/4357875#M684201</link>
    <description>Salman&lt;BR /&gt;&lt;BR /&gt;When a command is run, it may need input and it will also have standard output (stdout) and error output (stderr)&lt;BR /&gt;&lt;BR /&gt;"cmd &amp;gt; log" this will send standard output to log. If you add "2&amp;gt;&amp;amp;1" aswell, this will also send the error output to the log.&lt;BR /&gt;&lt;BR /&gt;Hope this explains a little better?&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 17 Feb 2009 21:15:57 GMT</pubDate>
    <dc:creator>Mark McDonald_2</dc:creator>
    <dc:date>2009-02-17T21:15:57Z</dc:date>
    <item>
      <title>Script hangs on error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-hangs-on-error/m-p/4357867#M684193</link>
      <description>Hi,&lt;BR /&gt;I have a script which i execute. The command i execute in this scripts needs a user response "press any key", if it faces any problem and script hangs there. I want my script not to hang and continue untill the last command of script. Can anyone help me how to solve this?&lt;BR /&gt;Another thing is, on my one server i see a cron job as follows&lt;BR /&gt;&lt;BR /&gt;/hotbackup.sh &amp;gt; g/hotbackup.log 2&amp;gt;&amp;amp;1&lt;BR /&gt; &lt;BR /&gt;I want to know only the meangs of "2&amp;gt;&amp;amp;1" at the end of this command.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Fri, 13 Feb 2009 04:17:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-hangs-on-error/m-p/4357867#M684193</guid>
      <dc:creator>Salman Ahmed Qureshi</dc:creator>
      <dc:date>2009-02-13T04:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: Script hangs on error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-hangs-on-error/m-p/4357868#M684194</link>
      <description>&amp;gt;The command I execute in this scripts needs a user response "press any key"&lt;BR /&gt;&lt;BR /&gt;You can redirect stdin to /dev/null for that step.  Or use yes(1):&lt;BR /&gt;yes | command ...&lt;BR /&gt;&lt;BR /&gt;&amp;gt;/hotbackup.sh &amp;gt; g/hotbackup.log 2&amp;gt;&amp;amp;1&lt;BR /&gt;&amp;gt;I want to know only the meaning of "2&amp;gt;&amp;amp;1"&lt;BR /&gt;&lt;BR /&gt;This says redirect stdout to that file, then also redirect stderr to the (new) value of stdout.&lt;BR /&gt;You had the equivalent to: 1&amp;gt; file 2&amp;gt;&amp;amp;1</description>
      <pubDate>Fri, 13 Feb 2009 04:29:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-hangs-on-error/m-p/4357868#M684194</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-02-13T04:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: Script hangs on error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-hangs-on-error/m-p/4357869#M684195</link>
      <description>Hi,&lt;BR /&gt;Thanks for the help.&lt;BR /&gt;Actually the command which fails also returns an output which i want to see and thats why i can't use  &amp;gt; /dev/null. So i also want to see the output of command and i also doesn't want it to wait for the input. I cam calling it as follows.&lt;BR /&gt;&lt;BR /&gt;./system_backup.sh &amp;gt; /scripts/sys_backup_out.log&lt;BR /&gt;&lt;BR /&gt;and sys_backup_out.log is my output file</description>
      <pubDate>Fri, 13 Feb 2009 04:50:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-hangs-on-error/m-p/4357869#M684195</guid>
      <dc:creator>Salman Ahmed Qureshi</dc:creator>
      <dc:date>2009-02-13T04:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: Script hangs on error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-hangs-on-error/m-p/4357870#M684196</link>
      <description>Hi,&lt;BR /&gt;let me explain a bot more, my this scrit runs some backup command on tape, if tape is not present, it hangs and asks to press any key. Even if i use "yes" as yuo told me in previous post, it again asks same question untell tape is ready. My intention is that if tape is not ready, it should not hang there and should come to the bottom and at the bottom, send me an email what ever the output of script is so that by checking email i can know whether backup was successfull or not. If i see error message in the email, i would insert the tape to take the backup. But if during script run if tape is  not there, script is waiting and waiting and waiting and not exitig.&lt;BR /&gt;Thanks&lt;BR /&gt;Thanks</description>
      <pubDate>Fri, 13 Feb 2009 04:58:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-hangs-on-error/m-p/4357870#M684196</guid>
      <dc:creator>Salman Ahmed Qureshi</dc:creator>
      <dc:date>2009-02-13T04:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: Script hangs on error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-hangs-on-error/m-p/4357871#M684197</link>
      <description>&amp;gt;I can't use &amp;gt; /dev/null. &lt;BR /&gt;&lt;BR /&gt;I said stdin but this doesn't solve your next request.  &amp;lt; /dev/null&lt;BR /&gt;&lt;BR /&gt;&amp;gt;it should not hang there and should come to the bottom and at the bottom, send me an email&lt;BR /&gt;&lt;BR /&gt;This is a problem.  It has to hang there.  But you could have another process that looks at the log file and possibly ps(1) and checks for that "press any key" and send you mail.&lt;BR /&gt;And then you have to figure out how to press that key.</description>
      <pubDate>Fri, 13 Feb 2009 05:46:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-hangs-on-error/m-p/4357871#M684197</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-02-13T05:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: Script hangs on error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-hangs-on-error/m-p/4357872#M684198</link>
      <description>Hi Dennis&lt;BR /&gt;I didnt understand this&lt;BR /&gt;&lt;BR /&gt;You had the equivalent to: 1&amp;gt; file 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;In my example, where should i look for the errors. Can you please explan a bit more.&lt;BR /&gt;&lt;BR /&gt;thanks in advance&lt;BR /&gt;&lt;BR /&gt;Salman</description>
      <pubDate>Fri, 13 Feb 2009 07:26:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-hangs-on-error/m-p/4357872#M684198</guid>
      <dc:creator>Salman Ahmed Qureshi</dc:creator>
      <dc:date>2009-02-13T07:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Script hangs on error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-hangs-on-error/m-p/4357873#M684199</link>
      <description>&amp;gt;In my example, where should i look for the errors.&lt;BR /&gt;&lt;BR /&gt;Basically you are redirecting both stdout AND stderr to g/hotbackup.log.</description>
      <pubDate>Fri, 13 Feb 2009 09:06:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-hangs-on-error/m-p/4357873#M684199</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-02-13T09:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: Script hangs on error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-hangs-on-error/m-p/4357874#M684200</link>
      <description>"Even if i use "yes" as yuo told me in previous post, it again asks same question untell tape is ready"&lt;BR /&gt;&lt;BR /&gt;that's going to be a problem, as it's not "hanging" there, its looping waiting for a response and a tape.  my initial thought was to stick the process (with the error redirected) might allow you to see the error, if its no stuck in the buffer, but won't allow you to "answer" the prompt when you do get a tape inserted.  &lt;BR /&gt;&lt;BR /&gt;perhaps you could check the status of the tape drive with "mt -f /dev/rmt/???" before you execute whatever backup command you are running.  if the tape isn't inserted / available, send your email and fail the remainder of the job.</description>
      <pubDate>Mon, 16 Feb 2009 19:35:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-hangs-on-error/m-p/4357874#M684200</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2009-02-16T19:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: Script hangs on error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-hangs-on-error/m-p/4357875#M684201</link>
      <description>Salman&lt;BR /&gt;&lt;BR /&gt;When a command is run, it may need input and it will also have standard output (stdout) and error output (stderr)&lt;BR /&gt;&lt;BR /&gt;"cmd &amp;gt; log" this will send standard output to log. If you add "2&amp;gt;&amp;amp;1" aswell, this will also send the error output to the log.&lt;BR /&gt;&lt;BR /&gt;Hope this explains a little better?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Feb 2009 21:15:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-hangs-on-error/m-p/4357875#M684201</guid>
      <dc:creator>Mark McDonald_2</dc:creator>
      <dc:date>2009-02-17T21:15:57Z</dc:date>
    </item>
  </channel>
</rss>

