<?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/2832872#M89320</link>
    <description>How about using the following -&lt;BR /&gt;&lt;BR /&gt;bdf /home /usr&lt;BR /&gt;&lt;BR /&gt;...Manjeet</description>
    <pubDate>Fri, 25 Oct 2002 13:16:18 GMT</pubDate>
    <dc:creator>Kellogg Unix Team</dc:creator>
    <dc:date>2002-10-25T13:16:18Z</dc:date>
    <item>
      <title>shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2832868#M89316</link>
      <description>Hi guys,&lt;BR /&gt;&lt;BR /&gt;the output of "df -k"  is giving the following output.&lt;BR /&gt;/home                   (/dev/vg02/lvol2     ) : 17364312 total allocated Kb&lt;BR /&gt;                                                   2772080 free allocated Kb&lt;BR /&gt;                                                  14592232 used allocated Kb&lt;BR /&gt;                                                        84 % allocation used&lt;BR /&gt;/usr                   (/dev/vg00/lvol7       ) :  1471160 total allocated Kb&lt;BR /&gt;                                                   1034935 free allocated Kb&lt;BR /&gt;                                                    436225 used allocated Kb&lt;BR /&gt;                                                        29 % allocation used&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;I want as followes.&lt;BR /&gt;/home                /usr&lt;BR /&gt;84 %                29 % &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;can some body suggest the shell script?&lt;BR /&gt;the script must use 'df' command ( not 'bdf').&lt;BR /&gt;Thnx in advance.&lt;BR /&gt;VB</description>
      <pubDate>Thu, 24 Oct 2002 16:25:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2832868#M89316</guid>
      <dc:creator>vas  bolpali</dc:creator>
      <dc:date>2002-10-24T16:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2832869#M89317</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Try the following but you may have to adjust the printf statements to cater for the maximum length filesystem name that you have (I have allowed only 10 chars...&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;let NUM=0&lt;BR /&gt;&lt;BR /&gt;df -k | {&lt;BR /&gt;while read A B C&lt;BR /&gt;do&lt;BR /&gt; if     [[ ${A} = /*(?) ]];&lt;BR /&gt; then   MP[NUM]=${A}&lt;BR /&gt;        continue&lt;BR /&gt; fi&lt;BR /&gt;&lt;BR /&gt; if     [[ ${B} = % ]];&lt;BR /&gt; then   PCT[NUM]=${A}&lt;BR /&gt;        let NUM=NUM+1&lt;BR /&gt;        continue&lt;BR /&gt; fi&lt;BR /&gt;done&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;let TOTAL=NUM&lt;BR /&gt;&lt;BR /&gt;let NUM=0&lt;BR /&gt;while ((NUM &amp;lt; TOTAL));&lt;BR /&gt;do&lt;BR /&gt; printf "%10s" ${MP[NUM]}&lt;BR /&gt; let NUM=NUM+1&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;print&lt;BR /&gt;&lt;BR /&gt;let NUM=0&lt;BR /&gt;while ((NUM &amp;lt; TOTAL));&lt;BR /&gt;do&lt;BR /&gt; printf "%9s\%" ${PCT[NUM]}&lt;BR /&gt; let NUM=NUM+1&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;print&lt;BR /&gt;&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;John</description>
      <pubDate>Thu, 24 Oct 2002 16:48:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2832869#M89317</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2002-10-24T16:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2832870#M89318</link>
      <description>#!/bin/ksh&lt;BR /&gt;echo "/home      /usr"&lt;BR /&gt;HOM=`df -k /home|grep %|awk '{print $1}'`&lt;BR /&gt;USR=`df -k /usr |grep %|awk '{print $1}'`&lt;BR /&gt;echo "$HOM %   $USR %"&lt;BR /&gt;&lt;BR /&gt;Sorry my first example was for /var and /usr. But now you can compare them both and see that there isn't much to make if work for any filesystem or any number of file systems.</description>
      <pubDate>Thu, 24 Oct 2002 17:16:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2832870#M89318</guid>
      <dc:creator>John Dvorchak</dc:creator>
      <dc:date>2002-10-24T17:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2832871#M89319</link>
      <description>#!/bin/ksh&lt;BR /&gt;echo "/var      /usr"&lt;BR /&gt;VAR=`df -k /var|grep %|awk '{print $1}'`&lt;BR /&gt;USR=`df -k /usr |grep %|awk '{print $1}'`&lt;BR /&gt;echo "$VAR %   $USR %"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This should work for you.</description>
      <pubDate>Thu, 24 Oct 2002 17:17:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2832871#M89319</guid>
      <dc:creator>John Dvorchak</dc:creator>
      <dc:date>2002-10-24T17:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2832872#M89320</link>
      <description>How about using the following -&lt;BR /&gt;&lt;BR /&gt;bdf /home /usr&lt;BR /&gt;&lt;BR /&gt;...Manjeet</description>
      <pubDate>Fri, 25 Oct 2002 13:16:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2832872#M89320</guid>
      <dc:creator>Kellogg Unix Team</dc:creator>
      <dc:date>2002-10-25T13:16:18Z</dc:date>
    </item>
  </channel>
</rss>

