<?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 in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2827626#M938028</link>
    <description>Try this&lt;BR /&gt;&lt;BR /&gt;awk '{line[NR]=$0}&lt;BR /&gt;END {&lt;BR /&gt;   for (i=0;i&amp;lt;=NR;i++) {&lt;BR /&gt;      if ( line[i] ~ /dbs/ ) {&lt;BR /&gt;        printf("%s %2.2f%\n",line[i],line[i+2]/line[i+1]*100)&lt;BR /&gt;      }&lt;BR /&gt;   }&lt;BR /&gt;}&lt;BR /&gt;' filename&lt;BR /&gt;&lt;BR /&gt;Chris</description>
    <pubDate>Thu, 17 Oct 2002 05:16:15 GMT</pubDate>
    <dc:creator>Christian Gebhardt</dc:creator>
    <dc:date>2002-10-17T05:16:15Z</dc:date>
    <item>
      <title>Shell Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2827624#M938026</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am writing a shell script which will give me the database free space information and alert. I am getting the following output :&lt;BR /&gt;&lt;BR /&gt;ds1dbs&lt;BR /&gt;5000000&lt;BR /&gt;991156&lt;BR /&gt;&lt;BR /&gt;tmpdbs&lt;BR /&gt;1000000&lt;BR /&gt;999944&lt;BR /&gt;&lt;BR /&gt;c3dbs&lt;BR /&gt;2000000&lt;BR /&gt;932508&lt;BR /&gt;&lt;BR /&gt;s2dbs&lt;BR /&gt;5000000&lt;BR /&gt;1860968&lt;BR /&gt;&lt;BR /&gt;rootdbs&lt;BR /&gt;512000&lt;BR /&gt;8815&lt;BR /&gt;&lt;BR /&gt;testdbs&lt;BR /&gt;4000000&lt;BR /&gt;1087746&lt;BR /&gt;&lt;BR /&gt;My requirement is that the script will calculate the percentage for all the above database like for testdbs:&lt;BR /&gt;1087746/4000000*100=27.19%.&lt;BR /&gt;&lt;BR /&gt;If this percentage is more then 80% then it should send a mail to me?&lt;BR /&gt;&lt;BR /&gt;Can anyone help me to get started?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Raje.</description>
      <pubDate>Thu, 17 Oct 2002 04:29:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2827624#M938026</guid>
      <dc:creator>Sanjiv Sharma_1</dc:creator>
      <dc:date>2002-10-17T04:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2827625#M938027</link>
      <description>percent=$(expr 100 \* $currentblocks / $maxblocks)</description>
      <pubDate>Thu, 17 Oct 2002 05:06:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2827625#M938027</guid>
      <dc:creator>Scott Van Kalken</dc:creator>
      <dc:date>2002-10-17T05:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2827626#M938028</link>
      <description>Try this&lt;BR /&gt;&lt;BR /&gt;awk '{line[NR]=$0}&lt;BR /&gt;END {&lt;BR /&gt;   for (i=0;i&amp;lt;=NR;i++) {&lt;BR /&gt;      if ( line[i] ~ /dbs/ ) {&lt;BR /&gt;        printf("%s %2.2f%\n",line[i],line[i+2]/line[i+1]*100)&lt;BR /&gt;      }&lt;BR /&gt;   }&lt;BR /&gt;}&lt;BR /&gt;' filename&lt;BR /&gt;&lt;BR /&gt;Chris</description>
      <pubDate>Thu, 17 Oct 2002 05:16:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2827626#M938028</guid>
      <dc:creator>Christian Gebhardt</dc:creator>
      <dc:date>2002-10-17T05:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2827627#M938029</link>
      <description>l1:/tmp 111 &amp;gt; perl -lne 'BEGIN{$/=undef}for(split/\n\n/){($d,$t,$u)=split/\n/;print"$d\t$t\t$u\t",100*$u/$t}' &amp;lt; output&lt;BR /&gt;ds1dbs  5000000 991156  19.82312&lt;BR /&gt;tmpdbs  1000000 999944  99.9944&lt;BR /&gt;c3dbs   2000000 932508  46.6254&lt;BR /&gt;s2dbs   5000000 1860968 37.21936&lt;BR /&gt;rootdbs 512000  8815    1.7216796875&lt;BR /&gt;testdbs 4000000 1087746 27.19365&lt;BR /&gt;l1:/tmp 112 &amp;gt;</description>
      <pubDate>Thu, 17 Oct 2002 05:20:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2827627#M938029</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-10-17T05:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2827628#M938030</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;using shell ... cat your input to this script :&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;while read DBS&lt;BR /&gt;do&lt;BR /&gt;  read BLOCKS&lt;BR /&gt;  read USED&lt;BR /&gt;  read&lt;BR /&gt;  PERC=$(($USED \* 100 / $BLOCKS))&lt;BR /&gt;  [ "$PERC" -gt 80 ] &amp;amp;&amp;amp;&lt;BR /&gt;  {&lt;BR /&gt;    echo "\n$DBS has ${PERC}% blocks used\n" | mailx -s "Free space in $DBS" phelix&lt;BR /&gt;  }&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;And you will receive :&lt;BR /&gt;&lt;BR /&gt;Date: Thu, 17 Oct 2002 09:16:30 +0200 (METDST)&lt;BR /&gt;From: Jean-Louis Phelix&lt;BR /&gt;To: phelix&lt;BR /&gt;Subject: Free space in tmpdbs&lt;BR /&gt;&lt;BR /&gt;tmpdbs has 99% blocks used</description>
      <pubDate>Thu, 17 Oct 2002 06:12:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2827628#M938030</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2002-10-17T06:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2827629#M938031</link>
      <description>Hi,&lt;BR /&gt;try the attached script with your input file as $1&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.</description>
      <pubDate>Thu, 17 Oct 2002 08:52:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2827629#M938031</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2002-10-17T08:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2827630#M938032</link>
      <description>Raje,&lt;BR /&gt;&lt;BR /&gt;Why did you give Jean-Louis Phelix only three (3) points and  nothing to john korterman yet for what are obiviously  correct answers?&lt;BR /&gt;&lt;BR /&gt;Is there something they missed?&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Thu, 17 Oct 2002 10:08:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2827630#M938032</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-10-17T10:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: Shell Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2827631#M938033</link>
      <description>TIMTOWTDI!&lt;BR /&gt;&lt;BR /&gt;How about this:&lt;BR /&gt;&lt;BR /&gt;perl -na00e 'printf "$F[0]:%.2f%%\n", $F[2]/$F[1]*100' database_output_file&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Leslie</description>
      <pubDate>Fri, 18 Oct 2002 12:41:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2827631#M938033</guid>
      <dc:creator>Leslie Chaim</dc:creator>
      <dc:date>2002-10-18T12:41:25Z</dc:date>
    </item>
  </channel>
</rss>

