<?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: grep only one column in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-only-one-column/m-p/2685333#M723294</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You can use:&lt;BR /&gt;bdf | awk '/some_text/ {print $1}'&lt;BR /&gt;&lt;BR /&gt;The result would be as if you only printed the first column from:&lt;BR /&gt;bdf | grep some_text&lt;BR /&gt;&lt;BR /&gt;Darrell</description>
    <pubDate>Mon, 18 Mar 2002 17:25:07 GMT</pubDate>
    <dc:creator>Darrell Allen</dc:creator>
    <dc:date>2002-03-18T17:25:07Z</dc:date>
    <item>
      <title>grep only one column</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-only-one-column/m-p/2685326#M723287</link>
      <description>Hi, i want to grep only one column out of the bdf command. is there one command (bdf | grep ...) to do this. i think with awk it is possible, but i don't know anything about awk :( is there a good documentation? thanx for help.</description>
      <pubDate>Mon, 18 Mar 2002 17:04:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-only-one-column/m-p/2685326#M723287</guid>
      <dc:creator>Maurice Skubski</dc:creator>
      <dc:date>2002-03-18T17:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: grep only one column</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-only-one-column/m-p/2685327#M723288</link>
      <description>Not clear exactly what you want.  If you just want the one column x you can do&lt;BR /&gt;bdf|cut -fx&lt;BR /&gt;&lt;BR /&gt;Ron</description>
      <pubDate>Mon, 18 Mar 2002 17:15:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-only-one-column/m-p/2685327#M723288</guid>
      <dc:creator>Ron Kinner</dc:creator>
      <dc:date>2002-03-18T17:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: grep only one column</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-only-one-column/m-p/2685328#M723289</link>
      <description>&lt;BR /&gt;Hi&lt;BR /&gt;&lt;BR /&gt;try this I think this is what you mean&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;bdf | awk '{ print $1 }' | grep xyz&lt;BR /&gt;&lt;BR /&gt;where $1 represents the column number in bdf&lt;BR /&gt;&lt;BR /&gt;cheers&lt;BR /&gt;John</description>
      <pubDate>Mon, 18 Mar 2002 17:16:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-only-one-column/m-p/2685328#M723289</guid>
      <dc:creator>John Carr_2</dc:creator>
      <dc:date>2002-03-18T17:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: grep only one column</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-only-one-column/m-p/2685329#M723290</link>
      <description>If you want to use awk, you can do this ..&lt;BR /&gt;something simple ..&lt;BR /&gt;&lt;BR /&gt;# bdf|awk '{print $1}'&lt;BR /&gt;==&amp;gt; will print 1st column&lt;BR /&gt;# bdf|awk '{print $2}'&lt;BR /&gt;==&amp;gt; will print 2nd column .. and so on.&lt;BR /&gt;&lt;BR /&gt;A good book on awk and sed is the O'Reilly book.</description>
      <pubDate>Mon, 18 Mar 2002 17:17:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-only-one-column/m-p/2685329#M723290</guid>
      <dc:creator>S.K. Chan</dc:creator>
      <dc:date>2002-03-18T17:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: grep only one column</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-only-one-column/m-p/2685330#M723291</link>
      <description>sorry, both things does not work. i need a command where i can get only the available memory output of a bdf command (column 4):&lt;BR /&gt;&lt;BR /&gt;   avail&lt;BR /&gt;   89711&lt;BR /&gt;   44471&lt;BR /&gt;  230522&lt;BR /&gt; 1847582&lt;BR /&gt;&lt;BR /&gt;and only this part. any idea?</description>
      <pubDate>Mon, 18 Mar 2002 17:22:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-only-one-column/m-p/2685330#M723291</guid>
      <dc:creator>Maurice Skubski</dc:creator>
      <dc:date>2002-03-18T17:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: grep only one column</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-only-one-column/m-p/2685331#M723292</link>
      <description>Have you tried ..&lt;BR /&gt;&lt;BR /&gt;# bdf|awk '{print $4}'&lt;BR /&gt;</description>
      <pubDate>Mon, 18 Mar 2002 17:24:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-only-one-column/m-p/2685331#M723292</guid>
      <dc:creator>S.K. Chan</dc:creator>
      <dc:date>2002-03-18T17:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: grep only one column</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-only-one-column/m-p/2685332#M723293</link>
      <description>oh, i replaced the $1 :(&lt;BR /&gt;now it is working. thak you for help!!!!</description>
      <pubDate>Mon, 18 Mar 2002 17:24:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-only-one-column/m-p/2685332#M723293</guid>
      <dc:creator>Maurice Skubski</dc:creator>
      <dc:date>2002-03-18T17:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: grep only one column</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-only-one-column/m-p/2685333#M723294</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You can use:&lt;BR /&gt;bdf | awk '/some_text/ {print $1}'&lt;BR /&gt;&lt;BR /&gt;The result would be as if you only printed the first column from:&lt;BR /&gt;bdf | grep some_text&lt;BR /&gt;&lt;BR /&gt;Darrell</description>
      <pubDate>Mon, 18 Mar 2002 17:25:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-only-one-column/m-p/2685333#M723294</guid>
      <dc:creator>Darrell Allen</dc:creator>
      <dc:date>2002-03-18T17:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: grep only one column</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-only-one-column/m-p/2685334#M723295</link>
      <description>Simple answer:&lt;BR /&gt;&lt;BR /&gt;bdf | awk '{print $4}'&lt;BR /&gt;&lt;BR /&gt;No grep needed since you are looking just for the 4th field where a field is separated by whitespace.  However, this will FAIL if the bdf is split scross 2 lines (as in a long NFS mountpoint).  In that case, you'll need something a bit more sophisticated:&lt;BR /&gt;&lt;BR /&gt;bdf | while read FS TOT USED AVAIL PERCENT MNT&lt;BR /&gt;do&lt;BR /&gt;if [ "$TOT" = "" ]&lt;BR /&gt;then&lt;BR /&gt;read TOT USED AVAIL PERCENT MNT&lt;BR /&gt;fi&lt;BR /&gt;echo $AVAIL&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;The advantage of the above code is that it will handle a 2-line bdf and also extracts all the rest of the columns, not just $AVAIL.</description>
      <pubDate>Mon, 18 Mar 2002 17:30:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-only-one-column/m-p/2685334#M723295</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2002-03-18T17:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: grep only one column</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-only-one-column/m-p/2685335#M723296</link>
      <description>Hi again&lt;BR /&gt;&lt;BR /&gt;I bet now you wish to omit the column heading and you can do that by using grep -v&lt;BR /&gt;&lt;BR /&gt;bdf | awk '{ print $4 }' | grep -v avail&lt;BR /&gt;&lt;BR /&gt;Ron's answer was also correct and simpler.&lt;BR /&gt;&lt;BR /&gt;bdf | cut -f4 | grep -v avail&lt;BR /&gt;&lt;BR /&gt;cheers&lt;BR /&gt;John</description>
      <pubDate>Mon, 18 Mar 2002 17:51:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-only-one-column/m-p/2685335#M723296</guid>
      <dc:creator>John Carr_2</dc:creator>
      <dc:date>2002-03-18T17:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: grep only one column</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/grep-only-one-column/m-p/2685336#M723297</link>
      <description>Bill,&lt;BR /&gt;I wasn't in on this thread but... I wanted to thank you for the valuable learning experience you provided in your "Sophisticated Code" example. &lt;BR /&gt;GREAT STUFF! :)&lt;BR /&gt;~jdk</description>
      <pubDate>Tue, 19 Mar 2002 13:51:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/grep-only-one-column/m-p/2685336#M723297</guid>
      <dc:creator>TrustNo1</dc:creator>
      <dc:date>2002-03-19T13:51:28Z</dc:date>
    </item>
  </channel>
</rss>

