<?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: extract data in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/extract-data/m-p/3145504#M156352</link>
    <description>D'oh! Obviously take the "#" out before the bdf....my cut and paste antics again.</description>
    <pubDate>Tue, 16 Dec 2003 03:12:32 GMT</pubDate>
    <dc:creator>James Murtagh</dc:creator>
    <dc:date>2003-12-16T03:12:32Z</dc:date>
    <item>
      <title>extract data</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/extract-data/m-p/3145501#M156349</link>
      <description>How can i extract field number 5 without the percentage sign n assign it to a variable.&lt;BR /&gt;&lt;BR /&gt;for example,&lt;BR /&gt;&lt;BR /&gt;/dev/vg00/lvol5 614400 177916 411617 30% /home&lt;BR /&gt;&lt;BR /&gt;for this case i hope to get 30 instead of 30%&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Rgs&lt;BR /&gt;&lt;BR /&gt;Cheng Wee</description>
      <pubDate>Tue, 16 Dec 2003 03:02:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/extract-data/m-p/3145501#M156349</guid>
      <dc:creator>Cheng Wee</dc:creator>
      <dc:date>2003-12-16T03:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: extract data</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/extract-data/m-p/3145502#M156350</link>
      <description>expr "/dev/vg00/lvol5 614400 177916 411617 30% /home" : '.* \(.*\)%'</description>
      <pubDate>Tue, 16 Dec 2003 03:05:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/extract-data/m-p/3145502#M156350</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-12-16T03:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: extract data</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/extract-data/m-p/3145503#M156351</link>
      <description>Hi Cheng Wee,&lt;BR /&gt;&lt;BR /&gt;Probably not the best way....but it works :&lt;BR /&gt;&lt;BR /&gt;# size=$(# bdf | awk '/vg00\/lvol5/ {print $5}' | cut -d% -f1)&lt;BR /&gt;&lt;BR /&gt;You would change the search pattern enclosed in the /.../ for a more general search.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;James.</description>
      <pubDate>Tue, 16 Dec 2003 03:11:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/extract-data/m-p/3145503#M156351</guid>
      <dc:creator>James Murtagh</dc:creator>
      <dc:date>2003-12-16T03:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: extract data</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/extract-data/m-p/3145504#M156352</link>
      <description>D'oh! Obviously take the "#" out before the bdf....my cut and paste antics again.</description>
      <pubDate>Tue, 16 Dec 2003 03:12:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/extract-data/m-p/3145504#M156352</guid>
      <dc:creator>James Murtagh</dc:creator>
      <dc:date>2003-12-16T03:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: extract data</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/extract-data/m-p/3145505#M156353</link>
      <description>#bdf|awk '{print $5}'|awk -F "%" '{print $1}'</description>
      <pubDate>Tue, 16 Dec 2003 03:21:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/extract-data/m-p/3145505#M156353</guid>
      <dc:creator>T G Manikandan</dc:creator>
      <dc:date>2003-12-16T03:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: extract data</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/extract-data/m-p/3145506#M156354</link>
      <description>They may be many ways, e.g.:&lt;BR /&gt;&lt;BR /&gt;echo "/dev/vg00/lvol5 614400 177916 411617 30% /home" | awk -F "[\t %]+" '{print $5}'&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;echo "/dev/vg00/lvol5   614400   177916   411617 30% /home" | sed -e 's/^[^%]*[\t ]\([0-9]*\)%[^%]*$/\1/'&lt;BR /&gt;&lt;BR /&gt;and many more :)</description>
      <pubDate>Tue, 16 Dec 2003 03:22:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/extract-data/m-p/3145506#M156354</guid>
      <dc:creator>Heiner E. Lennackers</dc:creator>
      <dc:date>2003-12-16T03:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: extract data</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/extract-data/m-p/3145507#M156355</link>
      <description>Hi Guys,&lt;BR /&gt;&lt;BR /&gt;Thks for the solution, i exam all n all are working as expected. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Dec 2003 03:24:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/extract-data/m-p/3145507#M156355</guid>
      <dc:creator>Cheng Wee</dc:creator>
      <dc:date>2003-12-16T03:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: extract data</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/extract-data/m-p/3145508#M156356</link>
      <description>bdf|grep /dev/vg00/lvol5|awk '{print $5}'|sed 's/%//g'&lt;BR /&gt;&lt;BR /&gt;Mark Syder (like the drink but spelt different)</description>
      <pubDate>Tue, 16 Dec 2003 03:26:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/extract-data/m-p/3145508#M156356</guid>
      <dc:creator>MarkSyder</dc:creator>
      <dc:date>2003-12-16T03:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: extract data</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/extract-data/m-p/3145509#M156357</link>
      <description>Actually, if youw ant a version that allows for NFS mounted filesystems and filesystems that go over two lines and will work ignore swap and /proc (on solaris) you could try this old thing I just dragged up of my hard disk&lt;BR /&gt; &lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt; @FILESYSTEMS=(`bdf 2&amp;gt;/dev/null`);&lt;BR /&gt; while($filesystem=pop @FILESYSTEMS){&lt;BR /&gt;                chop($filesystem);&lt;BR /&gt;                next if $filesystem =~ /.*Filesystem.*/;&lt;BR /&gt;                next if $filesystem =~ /swap.*/;&lt;BR /&gt;                next if $filesystem =~ /proc.*/;&lt;BR /&gt;&lt;BR /&gt;                ($waste,$waste2,$waste3,$waste4,$percentage,$fs)=split " ", $filesystem;&lt;BR /&gt;&lt;BR /&gt;                if($fs eq ""){ # A two line df filesystem output&lt;BR /&gt;                        $fs=$percentage;&lt;BR /&gt;                        $percentage=$waste4;&lt;BR /&gt;                        $filesystem=pop @FILESYSTEMS;&lt;BR /&gt;                }&lt;BR /&gt;&lt;BR /&gt;                next if $filesystem =~ /:/; # Lose NFS filesystems&lt;BR /&gt;              $percentage =~ /(.+)%/; # drop the % sign&lt;BR /&gt;                print "$fs $percentage\n";&lt;BR /&gt;}&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Dec 2003 03:29:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/extract-data/m-p/3145509#M156357</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-12-16T03:29:39Z</dc:date>
    </item>
  </channel>
</rss>

