<?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 filename changes before previous command finishes- BL870c in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/filename-changes-before-previous-command-finishes-bl870c/m-p/4702322#M659239</link>
    <description>We have a Bl870c server running HP-UX 11iv2, a Oracle Database server. The attached shell script pulls a file in from a sftp server and processes the file.&lt;BR /&gt;&lt;BR /&gt;The mv command to rename the file seems to execute before the previous awrun command can finish.  &lt;BR /&gt;&lt;BR /&gt;My assumption is that the awrun command is running on a different CPU than the mv command. &lt;BR /&gt;&lt;BR /&gt;Is there a way to make shell script wait for the previous command to finish before another?&lt;BR /&gt;&lt;BR /&gt;We put a sleep 10 command and it works fine.  &lt;BR /&gt;&lt;BR /&gt;Should we put a if [ $? = 0 ] then mv</description>
    <pubDate>Wed, 20 Oct 2010 16:31:44 GMT</pubDate>
    <dc:creator>Larry J. Griswold</dc:creator>
    <dc:date>2010-10-20T16:31:44Z</dc:date>
    <item>
      <title>filename changes before previous command finishes- BL870c</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filename-changes-before-previous-command-finishes-bl870c/m-p/4702322#M659239</link>
      <description>We have a Bl870c server running HP-UX 11iv2, a Oracle Database server. The attached shell script pulls a file in from a sftp server and processes the file.&lt;BR /&gt;&lt;BR /&gt;The mv command to rename the file seems to execute before the previous awrun command can finish.  &lt;BR /&gt;&lt;BR /&gt;My assumption is that the awrun command is running on a different CPU than the mv command. &lt;BR /&gt;&lt;BR /&gt;Is there a way to make shell script wait for the previous command to finish before another?&lt;BR /&gt;&lt;BR /&gt;We put a sleep 10 command and it works fine.  &lt;BR /&gt;&lt;BR /&gt;Should we put a if [ $? = 0 ] then mv</description>
      <pubDate>Wed, 20 Oct 2010 16:31:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filename-changes-before-previous-command-finishes-bl870c/m-p/4702322#M659239</guid>
      <dc:creator>Larry J. Griswold</dc:creator>
      <dc:date>2010-10-20T16:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: filename changes before previous command finishes- BL870c</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filename-changes-before-previous-command-finishes-bl870c/m-p/4702323#M659240</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Normally, commands in a script are simply executed synchronously so that nothing begins until the previous command (process) has completed (successfully or not).&lt;BR /&gt;&lt;BR /&gt;You don't say what the 'awrun' process is doing or how it is coded.  If it does something like a fork() to perform work, your shell script resume execution before the work is completed.&lt;BR /&gt;&lt;BR /&gt;If the simple sleep() works, you could continue to use that.  If the 'awrun' returns a useful return code, then, yes, I would test it and do the 'mv' accordingly, too.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 20 Oct 2010 16:50:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filename-changes-before-previous-command-finishes-bl870c/m-p/4702323#M659240</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-10-20T16:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: filename changes before previous command finishes- BL870c</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/filename-changes-before-previous-command-finishes-bl870c/m-p/4702324#M659241</link>
      <description>&amp;gt;Should we put a if [ $? = 0 ]&lt;BR /&gt;&lt;BR /&gt;The proper syntax (integer compare) is: [ $? -eq 0 ]</description>
      <pubDate>Wed, 20 Oct 2010 17:46:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/filename-changes-before-previous-command-finishes-bl870c/m-p/4702324#M659241</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-10-20T17:46:14Z</dc:date>
    </item>
  </channel>
</rss>

