<?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: I have problem in scripting in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/i-have-problem-in-scripting/m-p/4925929#M408968</link>
    <description>Usually to send email I would do-&lt;BR /&gt; &lt;BR /&gt;echo "Over 70 percent /tmp" | mailx -s "70% problem" joeuser@company.com&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
    <pubDate>Wed, 14 Sep 2005 09:17:41 GMT</pubDate>
    <dc:creator>Rodney Hills</dc:creator>
    <dc:date>2005-09-14T09:17:41Z</dc:date>
    <item>
      <title>I have problem in scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-have-problem-in-scripting/m-p/4925921#M408960</link>
      <description>Hi&lt;BR /&gt;How can i take and compare numeric value in "if" condition i have following script but that is not comparing numeric value and is not working according to condition&lt;BR /&gt;&lt;BR /&gt; 1  #!/usr/bin/sh&lt;BR /&gt;     2  NUM=`df -k /stand |awk '/allocation used/'`&lt;BR /&gt;     3  if [ $NUM -gt 70 ]&lt;BR /&gt;     4  then&lt;BR /&gt;     5  echo "$NUM"&lt;BR /&gt;     6  fi&lt;BR /&gt;     7  NUM=`df -k / |awk '/allocation used/'`&lt;BR /&gt;     8  if [ $NUM -gt 70 ]&lt;BR /&gt;     9  then&lt;BR /&gt;    10  echo "$NUM"&lt;BR /&gt;    11  fi&lt;BR /&gt;    12   NUM=`df -k /tmp |awk '/allocation used/'`&lt;BR /&gt;    13    if [ $NUM &amp;gt; 70 ]&lt;BR /&gt;    14    then&lt;BR /&gt;    15     echo "$NUM"&lt;BR /&gt;    16     fi&lt;BR /&gt;    17      NUM=`df -k /var |awk '/allocation used/'`&lt;BR /&gt;    18       if [ $NUM &amp;gt; 70 ]&lt;BR /&gt;    19       then &lt;BR /&gt;    20        echo "$NUM"&lt;BR /&gt;    21        fi&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Sep 2005 08:59:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-have-problem-in-scripting/m-p/4925921#M408960</guid>
      <dc:creator>Ammar_4</dc:creator>
      <dc:date>2005-09-14T08:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: I have problem in scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-have-problem-in-scripting/m-p/4925922#M408961</link>
      <description>Try-&lt;BR /&gt; &lt;BR /&gt;2 NUM=`df -k /stand |awk '/allocation used/{print $1}'`&lt;BR /&gt;3 if [ $NUM -gt 70 ]&lt;BR /&gt;4 then&lt;BR /&gt;5 echo "$NUM"&lt;BR /&gt;6 fi&lt;BR /&gt; &lt;BR /&gt;NUM was being set to the number plus the text that follows. The print $1 will print the 1st argument from the line.&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Wed, 14 Sep 2005 09:02:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-have-problem-in-scripting/m-p/4925922#M408961</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-09-14T09:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: I have problem in scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-have-problem-in-scripting/m-p/4925923#M408962</link>
      <description>I believe that you are missing quotes around the variable.  It should be &lt;BR /&gt;&lt;BR /&gt;if [ $NUM" -gt 70 ]&lt;BR /&gt;then&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;fi</description>
      <pubDate>Wed, 14 Sep 2005 09:05:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-have-problem-in-scripting/m-p/4925923#M408962</guid>
      <dc:creator>Alan Meyer_4</dc:creator>
      <dc:date>2005-09-14T09:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: I have problem in scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-have-problem-in-scripting/m-p/4925924#M408963</link>
      <description>I believe that you are missing quotes around the variable.  It should be &lt;BR /&gt;&lt;BR /&gt;if [ "$NUM" -gt 70 ]&lt;BR /&gt;then&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;oops  I missed one myself</description>
      <pubDate>Wed, 14 Sep 2005 09:06:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-have-problem-in-scripting/m-p/4925924#M408963</guid>
      <dc:creator>Alan Meyer_4</dc:creator>
      <dc:date>2005-09-14T09:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: I have problem in scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-have-problem-in-scripting/m-p/4925925#M408964</link>
      <description>declare NUM as integer&lt;BR /&gt;&lt;BR /&gt;---------------- sample --------------------&lt;BR /&gt;integer NUM=`df -k /var |awk '/allocation used/ {print $1}'`&lt;BR /&gt;if [[ ${NUM} -gt 70 ]]; then &lt;BR /&gt; echo "${NUM}"&lt;BR /&gt;fi &lt;BR /&gt;---------------- sample --------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Sep 2005 09:10:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-have-problem-in-scripting/m-p/4925925#M408964</guid>
      <dc:creator>Matthew_50</dc:creator>
      <dc:date>2005-09-14T09:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: I have problem in scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-have-problem-in-scripting/m-p/4925926#M408965</link>
      <description>Nevermind...  I was going by a syntax book, Sir Rodney's right.  ~warmsmile~</description>
      <pubDate>Wed, 14 Sep 2005 09:14:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-have-problem-in-scripting/m-p/4925926#M408965</guid>
      <dc:creator>Alan Meyer_4</dc:creator>
      <dc:date>2005-09-14T09:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: I have problem in scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-have-problem-in-scripting/m-p/4925927#M408966</link>
      <description>Please also tell me now if file system is running more than 70% then system send me email. i have used "mailx" but i didnot know how to link that script and how email work on specific condition</description>
      <pubDate>Wed, 14 Sep 2005 09:15:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-have-problem-in-scripting/m-p/4925927#M408966</guid>
      <dc:creator>Ammar_4</dc:creator>
      <dc:date>2005-09-14T09:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: I have problem in scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-have-problem-in-scripting/m-p/4925928#M408967</link>
      <description>actually &lt;BR /&gt;&lt;BR /&gt;NUM=`df -k /stand |awk '/allocation used/'`&lt;BR /&gt;echo $NUM&lt;BR /&gt;&lt;BR /&gt;returns something like:&lt;BR /&gt;&lt;BR /&gt;52 % allocation used&lt;BR /&gt;&lt;BR /&gt;which is not just numeric&lt;BR /&gt;&lt;BR /&gt;you should use&lt;BR /&gt;NUM=`df -k /stand |awk '/allocation used/{print $0}'`&lt;BR /&gt;&lt;BR /&gt;instead.</description>
      <pubDate>Wed, 14 Sep 2005 09:16:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-have-problem-in-scripting/m-p/4925928#M408967</guid>
      <dc:creator>Orhan Biyiklioglu</dc:creator>
      <dc:date>2005-09-14T09:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: I have problem in scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-have-problem-in-scripting/m-p/4925929#M408968</link>
      <description>Usually to send email I would do-&lt;BR /&gt; &lt;BR /&gt;echo "Over 70 percent /tmp" | mailx -s "70% problem" joeuser@company.com&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Wed, 14 Sep 2005 09:17:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-have-problem-in-scripting/m-p/4925929#M408968</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-09-14T09:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: I have problem in scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-have-problem-in-scripting/m-p/4925930#M408969</link>
      <description>.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;NUM=df -k /var |awk '/allocation used/{print $1}'&lt;BR /&gt;if [ $NUM -gt 70 ]&lt;BR /&gt;then&lt;BR /&gt;   echo "/var is above 70% utilized" |mailx email@address&lt;BR /&gt;fi&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Sep 2005 09:19:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-have-problem-in-scripting/m-p/4925930#M408969</guid>
      <dc:creator>Alan Meyer_4</dc:creator>
      <dc:date>2005-09-14T09:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: I have problem in scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/i-have-problem-in-scripting/m-p/4925931#M408970</link>
      <description>Thanks a lot&lt;BR /&gt;i am learning too much from u guys</description>
      <pubDate>Wed, 14 Sep 2005 09:23:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/i-have-problem-in-scripting/m-p/4925931#M408970</guid>
      <dc:creator>Ammar_4</dc:creator>
      <dc:date>2005-09-14T09:23:31Z</dc:date>
    </item>
  </channel>
</rss>

