<?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 giving error throuh crontab in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-giving-error-throuh-crontab/m-p/4377359#M684757</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Several things are amiss here.&lt;BR /&gt;&lt;BR /&gt;1.  There is no 'swap' command for HP-UX.  What operating system is this?  Did you mean to use 'swapinfo -tam' ?&lt;BR /&gt;&lt;BR /&gt;2. There is an extra double quote following the closing curly brace of the 'awk' script.&lt;BR /&gt;&lt;BR /&gt;3. You can't run the posted snippet in 'cron' unldess you _define_ the 'd1' variable you use in 'checklist_$d1'.  Cron tasks do _not_ inherit anything in your login 'profile' since it is not sourced (read) when the crontask is initiated.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Thu, 12 Mar 2009 10:59:04 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2009-03-12T10:59:04Z</dc:date>
    <item>
      <title>script giving error throuh crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-giving-error-throuh-crontab/m-p/4377355#M684753</link>
      <description>Hi All&lt;BR /&gt;&lt;BR /&gt;I have facing a problem in a scripting pls me out. When i m running the script manually it woking fine but through cron tab it is giving error in below portion.&lt;BR /&gt;&lt;BR /&gt;echo "Total swap utilisation is echo "Total swap utilisation is `swap -s | awk '&lt;BR /&gt;{&lt;BR /&gt;   swapused  = $9&lt;BR /&gt;   swapavail = $11&lt;BR /&gt;   swapusedlen = length(swapused) - 1&lt;BR /&gt;   swapavailen = length(swapavail) - 1&lt;BR /&gt;   usedk       = substr(swapused,1,swapusedlen)&lt;BR /&gt;   availk      = substr(swapavail,1,swapavailen)&lt;BR /&gt;   total       = availk + usedk&lt;BR /&gt;   percentage  = (usedk / total)*100&lt;BR /&gt;   printf("%3.0f %\n", percentage)&lt;BR /&gt;   &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;}'`" &amp;gt;&amp;gt; checklist_$d1&lt;BR /&gt;&lt;BR /&gt;instead of print the value of percentage, it is same percentage in output.&lt;BR /&gt;but manually its work</description>
      <pubDate>Thu, 12 Mar 2009 06:40:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-giving-error-throuh-crontab/m-p/4377355#M684753</guid>
      <dc:creator>Viney Kumar</dc:creator>
      <dc:date>2009-03-12T06:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: script giving error throuh crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-giving-error-throuh-crontab/m-p/4377356#M684754</link>
      <description>crontab only has a limited environment, &lt;BR /&gt;&lt;BR /&gt;you must use the full path to the commands in the script.&lt;BR /&gt;&lt;BR /&gt;OR&lt;BR /&gt;&lt;BR /&gt;do PATH=.... at the top of the script and include all necessary paths.</description>
      <pubDate>Thu, 12 Mar 2009 06:46:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-giving-error-throuh-crontab/m-p/4377356#M684754</guid>
      <dc:creator>Mark McDonald_2</dc:creator>
      <dc:date>2009-03-12T06:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: script giving error throuh crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-giving-error-throuh-crontab/m-p/4377357#M684755</link>
      <description>Thats the thing, you must be missing a path to the binarys you are using, you can use a PATH=/etc/etc , or load you profile at the begining . .profile</description>
      <pubDate>Thu, 12 Mar 2009 07:29:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-giving-error-throuh-crontab/m-p/4377357#M684755</guid>
      <dc:creator>likid0</dc:creator>
      <dc:date>2009-03-12T07:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: script giving error throuh crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-giving-error-throuh-crontab/m-p/4377358#M684756</link>
      <description>Hi All&lt;BR /&gt;&lt;BR /&gt;i have tried same but still same probelm&lt;BR /&gt;&lt;BR /&gt;pls look into the changes:--&lt;BR /&gt;PATH=$PATH:/usr/symcli/bin:/usr/local/bin:/usr/sbin:/usr/bin&lt;BR /&gt;export PATH&lt;BR /&gt;echo "Total swap utilisation is `/usr/sbin/swap -s | /usr/bin/awk '&lt;BR /&gt;{&lt;BR /&gt;   swapused  = $9&lt;BR /&gt;   swapavail = $11&lt;BR /&gt;   swapusedlen = length(swapused) - 1&lt;BR /&gt;   swapavailen = length(swapavail) - 1&lt;BR /&gt;   usedk       = substr(swapused,1,swapusedlen)&lt;BR /&gt;   availk      = substr(swapavail,1,swapavailen)&lt;BR /&gt;   total       = availk + usedk&lt;BR /&gt;   percentage  = (usedk / total)*100&lt;BR /&gt;   printf("%3.0f %\n", percentage)&lt;BR /&gt;   #print $percentage&lt;BR /&gt;}'`" &amp;gt;&amp;gt; checklist_$d1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and output is:--&lt;BR /&gt;Total swap utilisation is  %n, percentage)&lt;BR /&gt;   #print&lt;BR /&gt;}'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 12 Mar 2009 09:39:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-giving-error-throuh-crontab/m-p/4377358#M684756</guid>
      <dc:creator>Viney Kumar</dc:creator>
      <dc:date>2009-03-12T09:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: script giving error throuh crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-giving-error-throuh-crontab/m-p/4377359#M684757</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Several things are amiss here.&lt;BR /&gt;&lt;BR /&gt;1.  There is no 'swap' command for HP-UX.  What operating system is this?  Did you mean to use 'swapinfo -tam' ?&lt;BR /&gt;&lt;BR /&gt;2. There is an extra double quote following the closing curly brace of the 'awk' script.&lt;BR /&gt;&lt;BR /&gt;3. You can't run the posted snippet in 'cron' unldess you _define_ the 'd1' variable you use in 'checklist_$d1'.  Cron tasks do _not_ inherit anything in your login 'profile' since it is not sourced (read) when the crontask is initiated.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 12 Mar 2009 10:59:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-giving-error-throuh-crontab/m-p/4377359#M684757</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-03-12T10:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: script giving error through crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-giving-error-throuh-crontab/m-p/4377360#M684758</link>
      <description>&lt;P&gt;&amp;gt;printf("%3.0f %\n", percentage)&lt;BR /&gt;&lt;BR /&gt;awk(1) doesn't show that you can use () around printf, just:&lt;BR /&gt;printf "%3.0f %%\n", percentage&lt;BR /&gt;&lt;BR /&gt;(And you need to double up the literal "%".)&lt;/P&gt;</description>
      <pubDate>Sun, 04 Sep 2011 05:04:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-giving-error-throuh-crontab/m-p/4377360#M684758</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-09-04T05:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: script giving error throuh crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-giving-error-throuh-crontab/m-p/4377361#M684759</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Dennis: awk(1) doesn't show that you can use () around printf, just: printf "%3.0f %%\n", percentage&lt;BR /&gt;&lt;BR /&gt;Yet this works just fine:&lt;BR /&gt;&lt;BR /&gt;# awk 'END{printf("%3.0f %\n",95.9)}' /dev/null&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Thu, 12 Mar 2009 17:49:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-giving-error-throuh-crontab/m-p/4377361#M684759</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-03-12T17:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: script giving error throuh crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-giving-error-throuh-crontab/m-p/4377362#M684760</link>
      <description>"3. You can't run the posted snippet in 'cron' unldess you _define_ the 'd1' "&lt;BR /&gt;&lt;BR /&gt;well..it might run and produce "checklist_".</description>
      <pubDate>Thu, 12 Mar 2009 18:41:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-giving-error-throuh-crontab/m-p/4377362#M684760</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2009-03-12T18:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: script giving error throuh crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-giving-error-throuh-crontab/m-p/4377363#M684761</link>
      <description>Hi (again) :&lt;BR /&gt;&lt;BR /&gt;&amp;gt; OldSchool: well..it might run and produce "checklist_".&lt;BR /&gt;&lt;BR /&gt;Yes, that's correct, of course, and I should have said that explicitly rather than inferring "can't" to be equivalent to "should not".  I was trying to make the point that the user's environment is not necessarily going to be the same as a login environment unless steps are taken. :-)&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 12 Mar 2009 18:47:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-giving-error-throuh-crontab/m-p/4377363#M684761</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-03-12T18:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: script giving error throuh crontab</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-giving-error-throuh-crontab/m-p/4377364#M684762</link>
      <description>&amp;gt;Dennis: awk(1) doesn't show that you can use () around printf, just: printf "%3.0f %%\n", percentage&lt;BR /&gt;&lt;BR /&gt;&amp;gt;JRF: Yet this works just fine:&lt;BR /&gt;# awk 'END {printf("%3.0f %\n",95.9)}' /dev/null&lt;BR /&gt;&lt;BR /&gt;Ah, the Posix standard does allow the optional ().  But that missing %% is clearly an error.  If you use:&lt;BR /&gt;awk 'END{printf("%3.0f % depth\n",95.9)}' /dev/null&lt;BR /&gt;You'll get an error, since "% d" is a valid format:&lt;BR /&gt;awk: There are not enough parameters in printf statement %3.0f % depth</description>
      <pubDate>Fri, 13 Mar 2009 04:07:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-giving-error-throuh-crontab/m-p/4377364#M684762</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-03-13T04:07:51Z</dc:date>
    </item>
  </channel>
</rss>

