<?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: works on command line but does not work in cron in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877537#M774254</link>
    <description>All scripts, expecially in cron, should have the following code:&lt;BR /&gt; &lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;export PATH=/usr/bin&lt;BR /&gt; &lt;BR /&gt;However, in your code, you have not specified a location for the file "statistic_www". It will need a fullpath to ensure it goes where you want it. cron runs your script on your behalf but never performs a login so none of your /etc/profile and .profile will be run. And to further troubleshoot the problem, add the command set -x at the beginning of the script.</description>
    <pubDate>Tue, 10 Oct 2006 11:33:20 GMT</pubDate>
    <dc:creator>Bill Hassell</dc:creator>
    <dc:date>2006-10-10T11:33:20Z</dc:date>
    <item>
      <title>works on command line but does not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877531#M774248</link>
      <description>Hello..&lt;BR /&gt;&lt;BR /&gt;I made one script which code I will post...script works fine from CL but in cron it has problems with second nawk. Script:&lt;BR /&gt;&lt;BR /&gt;nawk -F"|" '          &lt;BR /&gt;{ s=substr($104,2,18)}&lt;BR /&gt;{b[s] ++s}&lt;BR /&gt;END { for (i in b) print i, b[i] } ' $1 &amp;gt; /path/to/file/TranId_www$2&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;q=$(cat /path/to/file/TranId_www$2 | wc -l)&lt;BR /&gt;echo $q &amp;gt; /path/to/file/zawww&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;nawk -F"|" -v x=$2 -v w=$(/usr/bin/cat /path/to/file/zawww) '&lt;BR /&gt;{u=u+1; l=l+$66}&lt;BR /&gt;($66 != 0)&amp;amp;&amp;amp;($110 == 1)&amp;amp;&amp;amp;($111 == 0) { a=a+1; s=s+$66}&lt;BR /&gt;END { print x"|"u"|"l"|"w"|"s } ' $1 &amp;gt;&amp;gt; statistic_www&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Also note that I got TranId_www$2 after script exec. in cron but statistic_www can not be appended..what might be an issue?&lt;BR /&gt;&lt;BR /&gt;Pleaseeeee can anyone figure out what is problem and why does second nawk make problems??&lt;BR /&gt;&lt;BR /&gt;THANKS in advance</description>
      <pubDate>Tue, 10 Oct 2006 07:25:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877531#M774248</guid>
      <dc:creator>amonamon</dc:creator>
      <dc:date>2006-10-10T07:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: works on command line but does not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877532#M774249</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Unless you have established your own PATH in your script, 'cron' has only provided a minimal one, notably:&lt;BR /&gt;&lt;BR /&gt;PATH=/usr/bin:/usr/sbin:.&lt;BR /&gt;&lt;BR /&gt;Make sure that you have what you think you do!&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 10 Oct 2006 07:29:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877532#M774249</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-10-10T07:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: works on command line but does not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877533#M774250</link>
      <description>As a follow-up to James' comments, the first thing that I see is "nawk", without a full path name.  You have to either define a PATH or provide full path names for everything!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Tue, 10 Oct 2006 07:34:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877533#M774250</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2006-10-10T07:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: works on command line but does not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877534#M774251</link>
      <description>Hi,&lt;BR /&gt;cat and echo may be missing their paths.&lt;BR /&gt;do you have a correct:&lt;BR /&gt; /path/to/file/zawww&lt;BR /&gt;file ?&lt;BR /&gt;&lt;BR /&gt;You could run the script in debug mode (include "set -x" as the start of the script)&lt;BR /&gt;to track the path of code.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Oct 2006 07:54:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877534#M774251</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-10-10T07:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: works on command line but does not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877535#M774252</link>
      <description>&lt;BR /&gt;Cron runs with only a limited shell - be sure to fully the path to all commands.&lt;BR /&gt;&lt;BR /&gt;In fact you may need to explicitly  set some more environment variables that are not set by cron limited shell.&lt;BR /&gt;&lt;BR /&gt;This is sometimes bypassed by using&lt;BR /&gt;&lt;BR /&gt;su -&lt;USER_ID&gt; -c "some command" as the line in cron in order to invoke a user's shell before the command&lt;/USER_ID&gt;</description>
      <pubDate>Tue, 10 Oct 2006 07:55:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877535#M774252</guid>
      <dc:creator>DCE</dc:creator>
      <dc:date>2006-10-10T07:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: works on command line but does not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877536#M774253</link>
      <description>well my path is OK..&lt;BR /&gt;it is not problem with path becouse I have my other script similar almost like this one:&lt;BR /&gt;&lt;BR /&gt;nawk -F"|" -v x=$2 '&lt;BR /&gt;{u=u+1; l=l+$66}&lt;BR /&gt;($66 != 0)&amp;amp;&amp;amp;($110 == 1)&amp;amp;&amp;amp;($111 == 0) { a=a+1; s=s+$66}  &lt;BR /&gt;#$66 != 0 { a=a+1; s=s+$66}&lt;BR /&gt;END { print x"|"u"|"l"|"a"|"s } ' $1 &amp;gt;&amp;gt; statistic_www&lt;BR /&gt;&lt;BR /&gt;and this works from my cron..so as U can see it can recognise nawk and other things..but in script from my first post first nawk is executed brcouse I can see TranId_www$2 but second is not becouse file does not append..&lt;BR /&gt;&lt;BR /&gt;any better ideas?? thanks for reply</description>
      <pubDate>Tue, 10 Oct 2006 08:11:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877536#M774253</guid>
      <dc:creator>amonamon</dc:creator>
      <dc:date>2006-10-10T08:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: works on command line but does not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877537#M774254</link>
      <description>All scripts, expecially in cron, should have the following code:&lt;BR /&gt; &lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;export PATH=/usr/bin&lt;BR /&gt; &lt;BR /&gt;However, in your code, you have not specified a location for the file "statistic_www". It will need a fullpath to ensure it goes where you want it. cron runs your script on your behalf but never performs a login so none of your /etc/profile and .profile will be run. And to further troubleshoot the problem, add the command set -x at the beginning of the script.</description>
      <pubDate>Tue, 10 Oct 2006 11:33:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877537#M774254</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2006-10-10T11:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: works on command line but does not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877538#M774255</link>
      <description>Hi amonamon,&lt;BR /&gt;&lt;BR /&gt;have you looked for statistic_www&lt;BR /&gt;in the cron user's home directory?&lt;BR /&gt;Does the mail to the cron user give any clue?&lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;John K.&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Oct 2006 14:15:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877538#M774255</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2006-10-10T14:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: works on command line but does not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877539#M774256</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;I guess you have not defined which shell you are using, try defining in the first line of the script.&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;hari</description>
      <pubDate>Tue, 10 Oct 2006 23:02:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877539#M774256</guid>
      <dc:creator>hari prasad_4</dc:creator>
      <dc:date>2006-10-10T23:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: works on command line but does not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877540#M774257</link>
      <description>OK please...how is then possible if I am having problems with path to be able to ececute script that I published 3 posts before???&lt;BR /&gt;as U can see it is almost the same script no export PATH, no specificatio on shell, no path to statistic_www...and this script works just fine in cron! but script that I published in first post can not be completely executed in cron..&lt;BR /&gt;&lt;BR /&gt;any clue??&lt;BR /&gt;thanks I hope that someone will give me a good hint which I have not tried yet.</description>
      <pubDate>Wed, 11 Oct 2006 00:59:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877540#M774257</guid>
      <dc:creator>amonamon</dc:creator>
      <dc:date>2006-10-11T00:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: works on command line but does not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877541#M774258</link>
      <description>hi,&lt;BR /&gt;what i mean to say is,an example:&lt;BR /&gt;if you are using sh then define it as #!/bin/sh&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;rgds,</description>
      <pubDate>Wed, 11 Oct 2006 01:09:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877541#M774258</guid>
      <dc:creator>hari prasad_4</dc:creator>
      <dc:date>2006-10-11T01:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: works on command line but does not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877542#M774259</link>
      <description>two simple cheap suggestions:&lt;BR /&gt;1. Can you check your /var/adm/cron/log and see if you have error there?&lt;BR /&gt;&lt;BR /&gt;2. Can you add "set -x" in your cronjob either at the top or before the second nawk ... and check /var/adm/cron/log after cronjon run</description>
      <pubDate>Wed, 11 Oct 2006 01:59:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877542#M774259</guid>
      <dc:creator>Yang Qin_1</dc:creator>
      <dc:date>2006-10-11T01:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: works on command line but does not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877543#M774260</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;did you get the zawww file? I think like others that this is a problem of the PATH variable. So if you dont get the zawww file, then try to use full path for cat and echo commands or set the PATH in your script to suite your needs.&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;&lt;BR /&gt;Regards Stefan</description>
      <pubDate>Wed, 11 Oct 2006 02:16:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877543#M774260</guid>
      <dc:creator>Stefan Schulz</dc:creator>
      <dc:date>2006-10-11T02:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: works on command line but does not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877544#M774261</link>
      <description>You KNOW it's the environment.  You just haven't found out how.  &lt;BR /&gt;&lt;BR /&gt;1.  add this to the top of you little program.&lt;BR /&gt;  "/usr/bin/env  &amp;gt; /tmp/my_env.txt"&lt;BR /&gt;2.  run it by hand.&lt;BR /&gt;3.  mv /tmp/my_env.txt  /tmp/my_env.byhand.&lt;BR /&gt;4.  run it by cron.&lt;BR /&gt;5.  mv /tmp/my_env.txt  /tmp/my_env.bycron.&lt;BR /&gt;6.  cd /tmp&lt;BR /&gt;7.  diff /tmp/my_env.byhand /tmp/my_env.bycron&lt;BR /&gt;&lt;BR /&gt;8.  look at the differences in the environment between running the job by hand and running the job by cron. &lt;BR /&gt;</description>
      <pubDate>Wed, 11 Oct 2006 07:14:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877544#M774261</guid>
      <dc:creator>Steve Post</dc:creator>
      <dc:date>2006-10-11T07:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: works on command line but does not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877545#M774262</link>
      <description>OK let me find what will be resoult of this command..&lt;BR /&gt;&lt;BR /&gt;I will reply soon..I hope that is an issue</description>
      <pubDate>Thu, 12 Oct 2006 06:20:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877545#M774262</guid>
      <dc:creator>amonamon</dc:creator>
      <dc:date>2006-10-12T06:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: works on command line but does not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877546#M774263</link>
      <description>#cat my_env.crontabÂ¸&lt;BR /&gt; &lt;BR /&gt;HOME=/&lt;BR /&gt;LOGNAME=root&lt;BR /&gt;PATH=/usr/sbin:/usr/bin&lt;BR /&gt;SHELL=/usr/bin/sh&lt;BR /&gt;TZ=MET&lt;BR /&gt;&lt;BR /&gt;# cat my_env.manual&lt;BR /&gt;&lt;BR /&gt;PMTAG=inetd&lt;BR /&gt;PWD=/export/home/roberto&lt;BR /&gt;ISTATE=enabled&lt;BR /&gt;TZ=MET&lt;BR /&gt;LC_MESSAGES=C&lt;BR /&gt;HZ=100&lt;BR /&gt;HOSTNAME=x5sel6&lt;BR /&gt;LD_LIBRARY_PATH=/usr/dt/lib:/usr/openwin/lib:/opt/SMAW/lib:/opt/Navisphere/lib&lt;BR /&gt;OMNI_HOME=/export/home/omni&lt;BR /&gt;PERL5LIB=:/opt/SMAW/SMAWsuf&lt;BR /&gt;NLSPATH=:/export/home/omni/locale/%L/%N.cat:/export/home/omni/locale/%L/%N&lt;BR /&gt;CLASSPATH=/export/home/omni/classes/Signalware.jar:&lt;BR /&gt;MANPATH=/usr/share/man:/opt/SMAW/man:/usr/dt/man:/usr/openwin/man:/usr/share/man:/export/home/omni/man:/usr/local/man:/opt/nsr/man:/opt/Navisphere/man&lt;BR /&gt;ENV=/.kshrc&lt;BR /&gt;_DVFS_RECONFIG=YES&lt;BR /&gt;LC_TIME=en_US.ISO8859-1&lt;BR /&gt;MACHTYPE=sparc-sun-solaris&lt;BR /&gt;XFILESEARCHPATH=/usr/dt/%T/%N%S:/usr/openwin/lib/%T/%N%S:&lt;BR /&gt;MAIL=/var/mail/root&lt;BR /&gt;EDITOR=vi&lt;BR /&gt;LANG=C&lt;BR /&gt;LC_NUMERIC=en_US.ISO8859-1&lt;BR /&gt;LOGNAME=root&lt;BR /&gt;SHLVL=2&lt;BR /&gt;LC_CTYPE=en_US.ISO8859-1&lt;BR /&gt;_=/usr/bin/env&lt;BR /&gt;SHELL=/bin/bash&lt;BR /&gt;HOSTTYPE=sparc&lt;BR /&gt;OSTYPE=solaris&lt;BR /&gt;HOME=/&lt;BR /&gt;TERM=vt100&lt;BR /&gt;PATH=/usr/local/sbin:/usr/local/bin:/export/home/omni/java/bin:/export/home/omni/bin:/usr/dt/bin:/usr/openwin/bin:/usr/sbin:/usr/bin:/opt/SMAW/bin:/opt/SMAW/sbin:/opt/nsr:/opt/FJSVhwr/sbin:/opt/SMAW/SMAWsuf/bin:/opt/Navisphere/bin&lt;BR /&gt;LC_MONETARY=en_US.ISO8859-1&lt;BR /&gt;SHM=0&lt;BR /&gt;LC_COLLATE=en_US.ISO8859-1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;so U were right it is not a same..but what should I do now in my case..&lt;BR /&gt;&lt;BR /&gt;please looking forward of hearing from U</description>
      <pubDate>Fri, 13 Oct 2006 08:14:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877546#M774263</guid>
      <dc:creator>amonamon</dc:creator>
      <dc:date>2006-10-13T08:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: works on command line but does not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877547#M774264</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;as mentioned somewhere above do a export PATH=.... at the beginning of your script.&lt;BR /&gt;&lt;BR /&gt;The PATH variable should contain all necessary paths to the commands and tools you use in your script (typically /usr/bin:/usr/sbin).&lt;BR /&gt;&lt;BR /&gt;That should do the trick.&lt;BR /&gt;&lt;BR /&gt;Kind Regards&lt;BR /&gt;&lt;BR /&gt;Stefan</description>
      <pubDate>Fri, 13 Oct 2006 08:21:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877547#M774264</guid>
      <dc:creator>Stefan Schulz</dc:creator>
      <dc:date>2006-10-13T08:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: works on command line but does not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877548#M774265</link>
      <description>well-- stefan thank U very much..but I am new to solaris..as U can notice..and I am little bit scared of this path export...&lt;BR /&gt;&lt;BR /&gt;if I put export PATH=...at the beginning of my script does it mean that path variables will be changed only during script execution in cron or forever???&lt;BR /&gt;If forever is the case than, I could create some other possible troubles..&lt;BR /&gt;&lt;BR /&gt;what do U think?</description>
      <pubDate>Fri, 13 Oct 2006 08:29:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877548#M774265</guid>
      <dc:creator>amonamon</dc:creator>
      <dc:date>2006-10-13T08:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: works on command line but does not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877549#M774266</link>
      <description>Ok this should work. &lt;BR /&gt;I took your local env data and removed anything that looked specific to your login.  I.e TERM, LOGIN, PWD....&lt;BR /&gt;&lt;BR /&gt;You have two choices for this text.&lt;BR /&gt;1.  Put text in your program you are running.  Put the text just below the #!/bin/??? that is on the top line. &lt;BR /&gt;&lt;BR /&gt;2a. Make a file like mycron.env and put this stuff in in.  &lt;BR /&gt;2b. Put the following line in your program you are running.  Put it just below the #!/bin/??? that is on the top line.&lt;BR /&gt;  the line:&lt;BR /&gt;.  /xxxx-the-full-path-xxxxx/mycron.env&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Then try running the stuff.  Besides the PATH needing to go in, I also see PERL5LIB is set, as well as a pile of other stuff. &lt;BR /&gt;&lt;BR /&gt;Here is your mycron.env.  &lt;BR /&gt;Steve&lt;BR /&gt;&lt;BR /&gt;the text:&lt;BR /&gt;PMTAG=inetd &lt;BR /&gt;ISTATE=enabled &lt;BR /&gt;TZ=MET &lt;BR /&gt;LC_MESSAGES=C &lt;BR /&gt;HZ=100 &lt;BR /&gt;HOSTNAME=x5sel6 &lt;BR /&gt;LD_LIBRARY_PATH=/usr/dt/lib:/usr/openwin/lib:/opt/SMAW/lib:/opt/Navisphere/lib &lt;BR /&gt;OMNI_HOME=/export/home/omni &lt;BR /&gt;PERL5LIB=:/opt/SMAW/SMAWsuf &lt;BR /&gt;NLSPATH=:/export/home/omni/locale/%L/%N.cat:/export/home/omni/locale/%L/%N &lt;BR /&gt;CLASSPATH=/export/home/omni/classes/Signalware.jar: &lt;BR /&gt;MANPATH=/usr/share/man:/opt/SMAW/man:/usr/dt/man:/usr/openwin/man:/usr/share&lt;BR /&gt;/man:/export/home/omni/man:/usr/local/man:/opt/nsr/man:/opt/Navisphere/man &lt;BR /&gt;ENV=/.kshrc &lt;BR /&gt;_DVFS_RECONFIG=YES &lt;BR /&gt;LC_TIME=en_US.ISO8859-1 &lt;BR /&gt;MACHTYPE=sparc-sun-solaris &lt;BR /&gt;XFILESEARCHPATH=/usr/dt/%T/%N%S:/usr/openwin/lib/%T/%N%S: &lt;BR /&gt;LANG=C &lt;BR /&gt;LC_NUMERIC=en_US.ISO8859-1 &lt;BR /&gt;LC_CTYPE=en_US.ISO8859-1 &lt;BR /&gt;SHELL=/bin/bash &lt;BR /&gt;HOSTTYPE=sparc &lt;BR /&gt;OSTYPE=solaris &lt;BR /&gt;PATH=/usr/local/sbin:/usr/local/bin:/export/home/omni/java/bin:/export/home/omni/bin:&lt;BR /&gt;/usr/dt/bin:/usr/openwin/bin:/usr/sbin:/usr/bin:/opt/SMAW/bin:/opt/SMAW/sbin:/opt/nsr:/o&lt;BR /&gt;pt/FJSVhwr/sbin:/opt/SMAW/SMAWsuf/bin:/opt/Navisphere/bin &lt;BR /&gt;LC_MONETARY=en_US.ISO8859-1 &lt;BR /&gt;SHM=0 &lt;BR /&gt;LC_COLLATE=en_US.ISO8859-1</description>
      <pubDate>Fri, 13 Oct 2006 08:31:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877549#M774266</guid>
      <dc:creator>Steve Post</dc:creator>
      <dc:date>2006-10-13T08:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: works on command line but does not work in cron</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877550#M774267</link>
      <description>sorry about that.  I'm typing while you're typing too.  The PATH variable and the others exist only for the job because they are either in the file (like I said for option1), or sourced to the file (like I said for option2). &lt;BR /&gt;Once the job is done, the variables are cleared.  You already painfully know this.  Most of your variables are NOT loaded when you run your script as a cronjob.</description>
      <pubDate>Fri, 13 Oct 2006 08:34:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/works-on-command-line-but-does-not-work-in-cron/m-p/3877550#M774267</guid>
      <dc:creator>Steve Post</dc:creator>
      <dc:date>2006-10-13T08:34:37Z</dc:date>
    </item>
  </channel>
</rss>

