<?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: Scripts run interactively , not under cron !!! in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449371#M769897</link>
    <description>Hi ,&lt;BR /&gt;&lt;BR /&gt;I might be wrong but I think you need to "source filename" in c shell as against . ./filename.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 02 Oct 2000 17:23:11 GMT</pubDate>
    <dc:creator>Vikas Khator</dc:creator>
    <dc:date>2000-10-02T17:23:11Z</dc:date>
    <item>
      <title>Scripts run interactively , not under cron !!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449355#M769881</link>
      <description>Hi.&lt;BR /&gt;&lt;BR /&gt;I have written a c shell script when run interactively works fine, when I submit it to run under cron, it says&lt;BR /&gt;&lt;BR /&gt;sqlplus: Command not found.&lt;BR /&gt;&lt;BR /&gt;I included in the script the line from the PATH pointing to where the sqlplus program is and I still get the same result.&lt;BR /&gt;&lt;BR /&gt;Any advice?.&lt;BR /&gt;&lt;BR /&gt;Thanking you in advance.&lt;BR /&gt;&lt;BR /&gt;Dave&lt;BR /&gt;</description>
      <pubDate>Mon, 02 Oct 2000 12:12:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449355#M769881</guid>
      <dc:creator>Dave Walley</dc:creator>
      <dc:date>2000-10-02T12:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts run interactively , not under cron !!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449356#M769882</link>
      <description>Verify that $ORACLE_SID,$ORACLE_HOME, $PATH are set correctly perhaps include a print statement in your script ?</description>
      <pubDate>Mon, 02 Oct 2000 12:20:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449356#M769882</guid>
      <dc:creator>Alex Glennie</dc:creator>
      <dc:date>2000-10-02T12:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts run interactively , not under cron !!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449357#M769883</link>
      <description>Hi,&lt;BR /&gt;Have you reset all your env variables in your script? since cron doesnt read your .profile/.kshrc...&lt;BR /&gt;&lt;BR /&gt;Good luck</description>
      <pubDate>Mon, 02 Oct 2000 12:20:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449357#M769883</guid>
      <dc:creator>Victor BERRIDGE</dc:creator>
      <dc:date>2000-10-02T12:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts run interactively , not under cron !!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449358#M769884</link>
      <description>Dave:&lt;BR /&gt;&lt;BR /&gt;You can source your profile ahead of calling your script.  This can/should be done in the crontab entry.  Alternatively, you could source your profile within the script itself to provide the necessary environmental variables you need.  Thirdly, you could create a new file which contains and exports the common variables needed for your application, and source (read) that within your standard profile, within standard scripts; and/or in a crontab stream.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 02 Oct 2000 12:25:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449358#M769884</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2000-10-02T12:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts run interactively , not under cron !!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449359#M769885</link>
      <description>cron provides only a very minimal environment to scripts that it issues. Try running the command 'env' from cron and you'll see what I mean.&lt;BR /&gt;&lt;BR /&gt;Your script will have to set up thing like PATH and other variables that are normally setup by /etc/profile and your .profile or C shell equivalent.&lt;BR /&gt;&lt;BR /&gt;As you are trying to run sqlplus, you will also have to setup the required ORACLE environment - ORACLE_HOME, ORACLE_SID, PATH and SHLIB_PATH (if Oracle 8) as well.&lt;BR /&gt;&lt;BR /&gt;Oracle provide scripts for this like 'oraenv' which are normally placed in /usr/local/bin. In batch mode, they require that ORACLE_SID has already been exported.&lt;BR /&gt;&lt;BR /&gt;Find out where the Oracle scripts have been installed and have a look at them. You can then call them as sub-scripts (. oraenv) from your cron'd script. Be aware that they are written for the Korn/Posix shell though.&lt;BR /&gt;</description>
      <pubDate>Mon, 02 Oct 2000 12:26:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449359#M769885</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2000-10-02T12:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts run interactively , not under cron !!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449360#M769886</link>
      <description>Dave:&lt;BR /&gt;&lt;BR /&gt;You can source your profile ahead of calling your script.  This can/should be done in the crontab entry.  Alternatively, you could source your profile within the script itself to provide the necessary environmental variables you need.  Thirdly, you could create a new file which contains and exports the common variables needed for your application, and source (read) that within your standard profile, within standard scripts; and/or in a crontab stream.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 02 Oct 2000 12:36:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449360#M769886</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2000-10-02T12:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts run interactively , not under cron !!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449361#M769887</link>
      <description>Thank you for your replies, I have included all my env variables in the script but still no luck.  How can I execute my .profile from within a c shell script. I have included it as the second line of the file.&lt;BR /&gt;&lt;BR /&gt;Looking forward to hearing from you once again.&lt;BR /&gt;&lt;BR /&gt;Dave</description>
      <pubDate>Mon, 02 Oct 2000 12:43:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449361#M769887</guid>
      <dc:creator>Dave Walley</dc:creator>
      <dc:date>2000-10-02T12:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts run interactively , not under cron !!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449362#M769888</link>
      <description>Dave:&lt;BR /&gt;&lt;BR /&gt;To source (read) a file within a script, put a dot (".") in front of the script name.  For instance, to source a file called /myscript you would do:&lt;BR /&gt;&lt;BR /&gt;. /myscript #...note the space between the dot and the script name.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 02 Oct 2000 12:47:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449362#M769888</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2000-10-02T12:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts run interactively , not under cron !!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449363#M769889</link>
      <description>Hi ,&lt;BR /&gt;&lt;BR /&gt;If you still have problems , post your script and we will go from there .</description>
      <pubDate>Mon, 02 Oct 2000 13:01:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449363#M769889</guid>
      <dc:creator>Vikas Khator</dc:creator>
      <dc:date>2000-10-02T13:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts run interactively , not under cron !!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449364#M769890</link>
      <description>I have tried including the .profile amd the oraenv setup files but still not working.  I attach the file for reference.  As you will see I am trying to write to a file when particular criteria has been met.&lt;BR /&gt;&lt;BR /&gt;Dave</description>
      <pubDate>Mon, 02 Oct 2000 14:28:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449364#M769890</guid>
      <dc:creator>Dave Walley</dc:creator>
      <dc:date>2000-10-02T14:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts run interactively , not under cron !!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449365#M769891</link>
      <description>Dave:&lt;BR /&gt;&lt;BR /&gt;Looking at your attachement, I would not expect it to work.  Your script is a C-shell but you have sourced a Posix shell profile (i.e. the . .profile).&lt;BR /&gt;&lt;BR /&gt;Try the following to debug your script:&lt;BR /&gt;&lt;BR /&gt;# csh -n /&lt;YOUR&gt;&lt;/YOUR&gt;# csh -v /&lt;YOUR&gt;&lt;/YOUR&gt;&lt;BR /&gt;The -n option parses but does not execute commands.  You can check syntax this way.&lt;BR /&gt;&lt;BR /&gt;The -v option causes commands to be echoed to stdout after substitutions are made.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 02 Oct 2000 14:38:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449365#M769891</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2000-10-02T14:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts run interactively , not under cron !!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449366#M769892</link>
      <description>Dave:&lt;BR /&gt;&lt;BR /&gt;BTW, while everyone has their preference, and while everyone is entitled, you will find that most people avoid the csh shell and/or aren't familar with its syntax.  The POSIX shell (/usr/bin/sh) is the standard shell in HP-UX and provides the most solid foundation for scripting.&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 02 Oct 2000 14:42:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449366#M769892</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2000-10-02T14:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts run interactively , not under cron !!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449367#M769893</link>
      <description>Hi!&lt;BR /&gt;&lt;BR /&gt;New to HP-UX and this forum - From an AIX background but think this will help:&lt;BR /&gt;&lt;BR /&gt;Try specifying the shell in the first line of the script. eg:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/csh&lt;BR /&gt;&lt;BR /&gt;Certainly in AIX, Sun and Linux cron runs jobs by default with the Bourne shell so any other you need to specify. I would guess that your login session is a c shell hence in runs interactivly.&lt;BR /&gt;&lt;BR /&gt;Hope it helps.&lt;BR /&gt;&lt;BR /&gt;Paul.</description>
      <pubDate>Mon, 02 Oct 2000 14:59:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449367#M769893</guid>
      <dc:creator>Paul Davies</dc:creator>
      <dc:date>2000-10-02T14:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts run interactively , not under cron !!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449368#M769894</link>
      <description>Apologies for earlier message - just read Dave's attachment and see that he does have the #!/usr/bin/csh line in (though in the attachment it is not the very first line). I'll look closer next time! :-)</description>
      <pubDate>Mon, 02 Oct 2000 15:07:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449368#M769894</guid>
      <dc:creator>Paul Davies</dc:creator>
      <dc:date>2000-10-02T15:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts run interactively , not under cron !!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449369#M769895</link>
      <description>Hi!&lt;BR /&gt;&lt;BR /&gt;1. Your crontab editing&lt;BR /&gt;&lt;BR /&gt;  # crontab -e&lt;BR /&gt;&lt;BR /&gt;  1 1 * * * su - ora8 -c "/Path/./yourscript"&lt;BR /&gt;&lt;BR /&gt;2. Try specifying the shell in the first&lt;BR /&gt;   line of the your script. &lt;BR /&gt;&lt;BR /&gt;  #!/usr/bin/csh   or   #!/bin/csh&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 02 Oct 2000 15:38:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449369#M769895</guid>
      <dc:creator>박수정</dc:creator>
      <dc:date>2000-10-02T15:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts run interactively , not under cron !!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449370#M769896</link>
      <description>step 1)&lt;BR /&gt;replace ". .profile" with ". /home/&lt;YOUR dir=""&gt;/.cshrc"&lt;BR /&gt;&lt;BR /&gt;step2) make plans to replace all csh scripts with either perl or ksh/sh scripts.&lt;BR /&gt;&lt;BR /&gt;&lt;OKAY&gt;&lt;BR /&gt;&lt;/OKAY&gt;&lt;/YOUR&gt;</description>
      <pubDate>Mon, 02 Oct 2000 15:43:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449370#M769896</guid>
      <dc:creator>Alan Riggs</dc:creator>
      <dc:date>2000-10-02T15:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts run interactively , not under cron !!!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449371#M769897</link>
      <description>Hi ,&lt;BR /&gt;&lt;BR /&gt;I might be wrong but I think you need to "source filename" in c shell as against . ./filename.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 02 Oct 2000 17:23:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-run-interactively-not-under-cron/m-p/2449371#M769897</guid>
      <dc:creator>Vikas Khator</dc:creator>
      <dc:date>2000-10-02T17:23:11Z</dc:date>
    </item>
  </channel>
</rss>

