<?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: df script problem in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766760#M895693</link>
    <description>Use 'di' available from &lt;A href="http://www.gentoo.com/di/di-3.6c.tar.gz" target="_blank"&gt;http://www.gentoo.com/di/di-3.6c.tar.gz&lt;/A&gt; runs on both AIX and HP-UX and is a wonderfull replacement for df and bdf.&lt;BR /&gt;&lt;BR /&gt;If you want parsable output, use 'mi' instead (linked to 'di')</description>
    <pubDate>Fri, 19 Jul 2002 12:50:33 GMT</pubDate>
    <dc:creator>H.Merijn Brand (procura</dc:creator>
    <dc:date>2002-07-19T12:50:33Z</dc:date>
    <item>
      <title>df script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766748#M895681</link>
      <description>HI,&lt;BR /&gt;I would like to obtain the filesystem's allocated size, its usage and its number of free space. I'm reading a list of filesystems from a text file. &lt;BR /&gt;&lt;BR /&gt;for i in `cat $1`&lt;BR /&gt;do&lt;BR /&gt;  df -k|awk '{x=$2-$3}{print $7, $2, $3, x}'&amp;gt;&amp;gt; /tmp/restore/FSlist/$1.txt&lt;BR /&gt;  grep -v "Mounted" /tmp/restore/FSlist/$1.txt &lt;BR /&gt;&amp;gt;&amp;gt; /tmp/restore/FSlist/$1.txt &lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;I would like to remove the string "Mounted 1024 blocks Free 1024" on the file passwd by $1.txt and rewritting the same file with the removed string pattern.&lt;BR /&gt;&lt;BR /&gt;However, the string above still appears in $1.txt file as:&lt;BR /&gt;&lt;BR /&gt;Mounted 1024 blocks Free 1024&lt;BR /&gt;/ fs37/nwdv.crtr.1 17890 7887 888&lt;BR /&gt;... ( and the list continues with the same pattern appearing for each filesystem size displayed.&lt;BR /&gt;&lt;BR /&gt;How do I remove the string "Mounted 1024 blocks Free 1024" from the file specified in $1? &lt;BR /&gt;&lt;BR /&gt;Also I would need to insert the following attributes for each columns of the display:&lt;BR /&gt;&lt;BR /&gt;Filesystem  Disk-Allocated Disk-Used Disk-Free &lt;BR /&gt;&lt;BR /&gt;Could someone show me how I could do this?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Jul 2002 05:11:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766748#M895681</guid>
      <dc:creator>Chern Jian Leaw</dc:creator>
      <dc:date>2002-07-18T05:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: df script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766749#M895682</link>
      <description>What's wrong with the 'bdf' command??</description>
      <pubDate>Thu, 18 Jul 2002 05:47:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766749#M895682</guid>
      <dc:creator>Michael Tully</dc:creator>
      <dc:date>2002-07-18T05:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: df script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766750#M895683</link>
      <description>Michael,&lt;BR /&gt;&lt;BR /&gt;I need to also run this script on an IBM AIX platform. I believe bdf does not exists on AIX platform.&lt;BR /&gt;&lt;BR /&gt;Any other ideas?&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Thu, 18 Jul 2002 05:49:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766750#M895683</guid>
      <dc:creator>Chern Jian Leaw</dc:creator>
      <dc:date>2002-07-18T05:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: df script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766751#M895684</link>
      <description>Hi Chern&lt;BR /&gt;&lt;BR /&gt;Try&lt;BR /&gt;&lt;BR /&gt;for i in `cat $1` &lt;BR /&gt;do &lt;BR /&gt;echo "Filesystem Disk-Allocated Disk-Used Disk-Free" &amp;gt;&amp;gt; &amp;gt;&amp;gt; /tmp/restore/FSlist/$1.txt&lt;BR /&gt;df -k|awk '{x=$2-$3}{print $7, $2, $3, x}'| grep -v Mounted &amp;gt;&amp;gt; tmp/restore/FSlist/$1.txt &lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;I'm not at a workstation at the moment so can't test the results but give it a try&lt;BR /&gt;&lt;BR /&gt;If it's not ok , post the results&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Thu, 18 Jul 2002 05:49:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766751#M895684</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2002-07-18T05:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: df script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766752#M895685</link>
      <description>For removing the string "Mounted 1024 blocks Free 1024" you can do the following:&lt;BR /&gt;&lt;BR /&gt;grep -v 'Mounted 1024 blocks Free 1024' FileThatHasToBeChanged &amp;gt; ChangedFile&lt;BR /&gt;&lt;BR /&gt;This gives you a new file without the unwanted string&lt;BR /&gt;&lt;BR /&gt;BB</description>
      <pubDate>Thu, 18 Jul 2002 06:00:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766752#M895685</guid>
      <dc:creator>Bart Beeren</dc:creator>
      <dc:date>2002-07-18T06:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: df script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766753#M895686</link>
      <description>Steve, BB,&lt;BR /&gt;&lt;BR /&gt;I've tried with both your ways, and it did eliminate the "Mounted 1024 blocks Free 1024" pattern and displays the format :&lt;BR /&gt;Filesystem Disk-Allocated Disk-Used Disk-Free &lt;BR /&gt;&lt;BR /&gt;However, it displays the format:&lt;BR /&gt;Filesystem Disk-Allocated Disk-Used Disk-Free &lt;BR /&gt;at every output for each filesystem i.e:&lt;BR /&gt;&lt;BR /&gt;Filesystem Disk-Allocated Disk-Used Disk-Free &lt;BR /&gt;/fs12/shark/ 577263 89877 90987&lt;BR /&gt;Filesystem Disk-Allocated Disk-Used Disk-Free &lt;BR /&gt;/fs12/shark.ct/ 577298 89877 90887&lt;BR /&gt;(and the pattern continues)&lt;BR /&gt;&lt;BR /&gt;Also the output above gets repeated over and over again.&lt;BR /&gt;&lt;BR /&gt;My script had been to modified as follows:&lt;BR /&gt;echo &amp;gt;&amp;gt;"Filesystem Disk-Allocated Disk-Used Disk-Free"&lt;BR /&gt;for i in `cat $1` &lt;BR /&gt;do &lt;BR /&gt;df -k|awk '{x=$2-$3}{print $7, $2, $3, x}'&amp;gt;&amp;gt; /tmp/restore/FSlist/$1.txt &lt;BR /&gt;grep -v "Mounted" /tmp/restore/FSlist/$1.txt &lt;BR /&gt;&amp;gt;&amp;gt; /tmp/restore/FSlist/$1.txt &lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;Could someone point my mistake please? I need to solve it urgently.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Jul 2002 06:15:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766753#M895686</guid>
      <dc:creator>Chern Jian Leaw</dc:creator>
      <dc:date>2002-07-18T06:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: df script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766754#M895687</link>
      <description>Hi Chern&lt;BR /&gt;&lt;BR /&gt;Sorry I though you wanted each entry to have the header &lt;BR /&gt;&lt;BR /&gt;Filesystem Disk-Allocated Disk-Used Disk-Free &lt;BR /&gt;&lt;BR /&gt;Which I why I put the echo "Filesystem Disk-Allocated Disk-Used Disk-Free" &amp;gt;&amp;gt;&lt;BR /&gt;&lt;BR /&gt;Inside the loop&lt;BR /&gt;&lt;BR /&gt;Just take it outside of the loop before the &lt;BR /&gt;for i in `cat $1`&lt;BR /&gt;&lt;BR /&gt;The only thing i can see wrong is you have created variable $i which is basically every entry in your $1&lt;BR /&gt;&lt;BR /&gt;Try this&lt;BR /&gt;&lt;BR /&gt;echo "Filesystem Disk-Allocated Disk-Used Disk-Free" &amp;gt;&amp;gt; /tmp/restore/FSlist/$1.txt &lt;BR /&gt;&lt;BR /&gt;for i in $(cat $1)&lt;BR /&gt;do&lt;BR /&gt;df -k $i |awk '{x=$2-$3}{print $7, $2, $3, x}'&amp;gt;&amp;gt; /tmp/restore/FSlist/$1.txt &lt;BR /&gt;grep -v "Mounted" /tmp/restore/FSlist/$1.txt &lt;BR /&gt;&amp;gt;&amp;gt; /tmp/restore/FSlist/$1.txt &lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Steve&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Thu, 18 Jul 2002 06:28:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766754#M895687</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2002-07-18T06:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: df script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766755#M895688</link>
      <description>Chern&lt;BR /&gt;&lt;BR /&gt;Whoops! missed out the grep -v&lt;BR /&gt;&lt;BR /&gt;for i in $(cat $1) &lt;BR /&gt;do &lt;BR /&gt;df -k $i |awk '{x=$2-$3}{print $7, $2, $3, x}'| grep -v mounted &amp;gt;&amp;gt; /tmp/restore/FSlist/$1.txt &lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;HTH &lt;BR /&gt;&lt;BR /&gt;Steve&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Jul 2002 06:36:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766755#M895688</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2002-07-18T06:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: df script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766756#M895689</link>
      <description>Hi Chern,&lt;BR /&gt;&lt;BR /&gt;I don't want to get into your parsing problem details, as already the others have engaged in, nor do I want to dissuade you from writing a kind of generic shell script disk free stat.&lt;BR /&gt;&lt;BR /&gt;Just would like to ask if Perl would be an option to you?&lt;BR /&gt;I experienced whenever I've had to write something generic which is supposed to run on a multitude of platforms the easiest sollution would call for a Perl script (Perl isn't only limitted to Unices, but also runs on Win32, Mac...)&lt;BR /&gt;&lt;BR /&gt;Just to draw your attention to some useful CPAN modules for your kind of "problem".&lt;BR /&gt;Have a look at&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.cpan.org/modules/by-module/Filesys/Filesys-DiskFree-0.06.readme" target="_blank"&gt;http://www.cpan.org/modules/by-module/Filesys/Filesys-DiskFree-0.06.readme&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.cpan.org/modules/by-module/Filesys/Filesys-DiskSpace-0.05.readme" target="_blank"&gt;http://www.cpan.org/modules/by-module/Filesys/Filesys-DiskSpace-0.05.readme&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Jul 2002 06:46:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766756#M895689</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2002-07-18T06:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: df script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766757#M895690</link>
      <description>Steve, &lt;BR /&gt;The output layout is better now, having the format:&lt;BR /&gt;Filesystem Disk-Allocated Disk-Used Disk-Free &lt;BR /&gt;&lt;BR /&gt;and no more repeated outputs. However, instead of displaying details for a particular input file which contains a list of filesystems, it also displays the disk-usage of other filesystems which is not specified in the input file, but within the system.  &lt;BR /&gt;&lt;BR /&gt;The input file to $1 looks is as follows:&lt;BR /&gt;cat $1&lt;BR /&gt;/circuits/layout&lt;BR /&gt;/stor/physical&lt;BR /&gt;/stor/circuit_design&lt;BR /&gt;&lt;BR /&gt;I'm running the script on a fileserver.&lt;BR /&gt;&lt;BR /&gt;Any ideas on how I should solve it?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Jul 2002 07:09:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766757#M895690</guid>
      <dc:creator>Chern Jian Leaw</dc:creator>
      <dc:date>2002-07-18T07:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: df script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766758#M895691</link>
      <description>Chern&lt;BR /&gt;&lt;BR /&gt;Lets say the file that contains your filesystems is in /tmp called /tmp/fsystem&lt;BR /&gt;&lt;BR /&gt;Then at the beginning of your script&lt;BR /&gt;&lt;BR /&gt;FILES=/tmp/fsystem&lt;BR /&gt;&lt;BR /&gt;for i in $(cat $FILES) &lt;BR /&gt;do &lt;BR /&gt;df -k $i |awk '{x=$2-$3}{print $7, $2, $3, x}'| grep -v mounted &amp;gt;&amp;gt; /tmp/restore/FSlist/$1.txt &lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;That way the script should only look at the contents of your file /tmp/fsystem&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Steve&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Jul 2002 07:18:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766758#M895691</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2002-07-18T07:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: df script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766759#M895692</link>
      <description>Chern&lt;BR /&gt;&lt;BR /&gt;How did you get on with your script ? Did the last input work for you ?&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Fri, 19 Jul 2002 12:33:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766759#M895692</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2002-07-19T12:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: df script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766760#M895693</link>
      <description>Use 'di' available from &lt;A href="http://www.gentoo.com/di/di-3.6c.tar.gz" target="_blank"&gt;http://www.gentoo.com/di/di-3.6c.tar.gz&lt;/A&gt; runs on both AIX and HP-UX and is a wonderfull replacement for df and bdf.&lt;BR /&gt;&lt;BR /&gt;If you want parsable output, use 'mi' instead (linked to 'di')</description>
      <pubDate>Fri, 19 Jul 2002 12:50:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766760#M895693</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-07-19T12:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: df script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766761#M895694</link>
      <description>&lt;BR /&gt;I simply use&lt;BR /&gt;&lt;BR /&gt;df -klP $(cat $1)&lt;BR /&gt;&lt;BR /&gt;on both HPUX and Linux. I imagine it will also work on AIX and Solaris.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Jul 2002 17:52:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766761#M895694</guid>
      <dc:creator>Jordan Bean</dc:creator>
      <dc:date>2002-07-19T17:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: df script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766762#M895695</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Try some of the scripts mentioned / attached in the link below,&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/0,,0x026250011d20d6118ff40090279cd0f9,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/0,,0x026250011d20d6118ff40090279cd0f9,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;There are a lot of useful scripts in that link.&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;regds&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Jul 2002 18:13:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/df-script-problem/m-p/2766762#M895695</guid>
      <dc:creator>Sanjay_6</dc:creator>
      <dc:date>2002-07-19T18:13:12Z</dc:date>
    </item>
  </channel>
</rss>

