<?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: shell script - cannot open in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-cannot-open/m-p/2805968#M83017</link>
    <description>Eric,&lt;BR /&gt;&lt;BR /&gt;I believe that you are hitting:&lt;BR /&gt;&lt;BR /&gt;JAGad98139  N  5  hpux.cmd.iso.shells   POSIX sh(1) removes here-doc before RHS of pipe can read it&lt;BR /&gt;&lt;BR /&gt;The 11.11 fix is planned to be included in the next Posix-Shell cumulative patch (PHCO_27017).&lt;BR /&gt;Maybe your local repsonse center is able to provide you a pre-release of that patch if you tell the CR number above.&lt;BR /&gt;&lt;BR /&gt;Regards...&lt;BR /&gt; Dietmar.</description>
    <pubDate>Fri, 13 Sep 2002 13:32:38 GMT</pubDate>
    <dc:creator>Dietmar Konermann</dc:creator>
    <dc:date>2002-09-13T13:32:38Z</dc:date>
    <item>
      <title>shell script - cannot open</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-cannot-open/m-p/2805959#M83008</link>
      <description>Hi everyone.  Got a vague error in quite a few of my scripts that is really starting to bug me.  I thought I had the resolution to it but am afraid that it has reared it's ugly head again.  Anyway here is the error I get randomly.&lt;BR /&gt;&lt;BR /&gt;&amp;lt;scriptname&amp;gt;[795634018]: /tmp/sh28697.1: cannot open&lt;BR /&gt;&lt;BR /&gt;Now I had assumed this was because I had sticky bit set on /tmp and I wasn't cleaning /tmp have some scripts that are not cleaning up temp files they are creating.  And another process eventually would get the same process id and attempt to create the file that was still there.  Now keep in mind these are not 'my' temp files but ones that the shell is creating for what ever reason.  &lt;BR /&gt;&lt;BR /&gt;So I set a cron job to clean these up if they were over 3 days old.  &lt;BR /&gt;&lt;BR /&gt;Short of turning off the sticky bit, is there a way to fix this?  Or is this a different error and I am heading down the wrong path?&lt;BR /&gt;&lt;BR /&gt;TIA!&lt;BR /&gt;Eric</description>
      <pubDate>Fri, 13 Sep 2002 12:48:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-cannot-open/m-p/2805959#M83008</guid>
      <dc:creator>Eric Buckner</dc:creator>
      <dc:date>2002-09-13T12:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: shell script - cannot open</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-cannot-open/m-p/2805960#M83009</link>
      <description>Eric,&lt;BR /&gt;&lt;BR /&gt;Curious mostly - why do you have the sticky bit set on /tmp?&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Fri, 13 Sep 2002 12:51:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-cannot-open/m-p/2805960#M83009</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2002-09-13T12:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: shell script - cannot open</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-cannot-open/m-p/2805961#M83010</link>
      <description>Our developers write scripts that are wrappers to their PL/SQL.  And as such they use /tmp quite a bit.  The sticky bit was the only way I could guarantee that they wouldn't step on another process.&lt;BR /&gt;&lt;BR /&gt;Eric</description>
      <pubDate>Fri, 13 Sep 2002 12:55:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-cannot-open/m-p/2805961#M83010</guid>
      <dc:creator>Eric Buckner</dc:creator>
      <dc:date>2002-09-13T12:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: shell script - cannot open</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-cannot-open/m-p/2805962#M83011</link>
      <description>Hi Eric:&lt;BR /&gt;&lt;BR /&gt;Setting the sticky bit on the /tmp directory simply means that only the owner of a file has permission to remove it.&lt;BR /&gt;&lt;BR /&gt;The best approach to managing (i.e. cleaning-up) temporary files created by a script is to create a directory for all of the temporarary files a script will create and declare a trap which unconditionally removes the directory and files at the script's completion:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;TMPDIR=/var/tmp/${0##*/}.${$} #...or /tmp...&lt;BR /&gt;...&lt;BR /&gt;trap 'rm -rf $TMPDIR' EXIT&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 13 Sep 2002 12:59:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-cannot-open/m-p/2805962#M83011</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-09-13T12:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: shell script - cannot open</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-cannot-open/m-p/2805963#M83012</link>
      <description>Eric,&lt;BR /&gt;&lt;BR /&gt;I guess I would be more inclined to discourage the developers from using /tmp.  Give them another playpen to trash that's not going to interfere with your work.&lt;BR /&gt;&lt;BR /&gt;Just a thought,&lt;BR /&gt;Pete</description>
      <pubDate>Fri, 13 Sep 2002 13:01:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-cannot-open/m-p/2805963#M83012</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2002-09-13T13:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: shell script - cannot open</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-cannot-open/m-p/2805964#M83013</link>
      <description>James,&lt;BR /&gt;   Yes that is exactly why I have the sticky bit turned on for /tmp.  We had a rash of issues where developer written scripts were removing files owned by other users because they matched a pattern.  And to force some sort of sanity, I had to turn it on.&lt;BR /&gt;&lt;BR /&gt;Pete,&lt;BR /&gt;   Unfortunately they aren't using /tmp of their own accord.  I have an expansive space for temporary stuff that they are supposed to use by application.  These are files that the shell is actually creating.  I did find a small blurb concerning junk /tmp/sh* files that could possibly be part of the problem.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Below is that blurb.  The shells in question are doing &amp;lt;&amp;lt; redirection into SQLPLUS and assigning that output to a variable.&lt;BR /&gt;&lt;BR /&gt;***&lt;BR /&gt;If &amp;lt;&amp;lt; is used to provide standard input to an asynchronous process invoked by &amp;amp;, the shell gets mixed up about naming the input document; a garbage file /tmp/sh* is created and the shell complains about not being able to find that file by another name. &lt;BR /&gt;***&lt;BR /&gt;</description>
      <pubDate>Fri, 13 Sep 2002 13:17:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-cannot-open/m-p/2805964#M83013</guid>
      <dc:creator>Eric Buckner</dc:creator>
      <dc:date>2002-09-13T13:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: shell script - cannot open</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-cannot-open/m-p/2805965#M83014</link>
      <description>Eric,&lt;BR /&gt;&lt;BR /&gt;that temporary files are created by the shell, when you use so-called "here-docs", e.g.:&lt;BR /&gt;&lt;BR /&gt;cat &amp;gt;file &amp;lt;&amp;lt; EOI&lt;BR /&gt; this &lt;BR /&gt; is&lt;BR /&gt; a &lt;BR /&gt; here-doc&lt;BR /&gt;EOI&lt;BR /&gt;&lt;BR /&gt;There are known problems with Posix- and Korn-Shells removing their tmp file too quickly.&lt;BR /&gt;&lt;BR /&gt;What OS revision are you using?&lt;BR /&gt;&lt;BR /&gt;Regards...&lt;BR /&gt; Dietmar.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 13 Sep 2002 13:18:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-cannot-open/m-p/2805965#M83014</guid>
      <dc:creator>Dietmar Konermann</dc:creator>
      <dc:date>2002-09-13T13:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: shell script - cannot open</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-cannot-open/m-p/2805966#M83015</link>
      <description>James,&lt;BR /&gt;   Sorry I did want to follow up on that cleanup idea.  I am thinking that it wouldn't be such a bad idea to have some sort of trap removal but not exactly sure how to do this with files that the shell is creating rather than the developer/user.</description>
      <pubDate>Fri, 13 Sep 2002 13:19:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-cannot-open/m-p/2805966#M83015</guid>
      <dc:creator>Eric Buckner</dc:creator>
      <dc:date>2002-09-13T13:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: shell script - cannot open</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-cannot-open/m-p/2805967#M83016</link>
      <description>Dietmar,&lt;BR /&gt;   We are running 11.11.  Do you know of a patch or anything that can resolve this? &lt;BR /&gt;&lt;BR /&gt;Eric</description>
      <pubDate>Fri, 13 Sep 2002 13:22:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-cannot-open/m-p/2805967#M83016</guid>
      <dc:creator>Eric Buckner</dc:creator>
      <dc:date>2002-09-13T13:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: shell script - cannot open</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-cannot-open/m-p/2805968#M83017</link>
      <description>Eric,&lt;BR /&gt;&lt;BR /&gt;I believe that you are hitting:&lt;BR /&gt;&lt;BR /&gt;JAGad98139  N  5  hpux.cmd.iso.shells   POSIX sh(1) removes here-doc before RHS of pipe can read it&lt;BR /&gt;&lt;BR /&gt;The 11.11 fix is planned to be included in the next Posix-Shell cumulative patch (PHCO_27017).&lt;BR /&gt;Maybe your local repsonse center is able to provide you a pre-release of that patch if you tell the CR number above.&lt;BR /&gt;&lt;BR /&gt;Regards...&lt;BR /&gt; Dietmar.</description>
      <pubDate>Fri, 13 Sep 2002 13:32:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-cannot-open/m-p/2805968#M83017</guid>
      <dc:creator>Dietmar Konermann</dc:creator>
      <dc:date>2002-09-13T13:32:38Z</dc:date>
    </item>
  </channel>
</rss>

