<?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: Newbie grep question... in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/newbie-grep-question/m-p/5012409#M426749</link>
    <description>If you want only 1st line use head:&lt;BR /&gt;&lt;BR /&gt;ioscan -fnC disk | grep '/dev/rdsk/c7t0d1' | head -n1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;ivan</description>
    <pubDate>Mon, 06 Nov 2006 12:07:41 GMT</pubDate>
    <dc:creator>Ivan Krastev</dc:creator>
    <dc:date>2006-11-06T12:07:41Z</dc:date>
    <item>
      <title>Newbie grep question...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/newbie-grep-question/m-p/5012406#M426746</link>
      <description>Here's my commandline...&lt;BR /&gt;ioscan -fnC disk | grep '/dev/rdsk/c7t0d1'&lt;BR /&gt;&lt;BR /&gt;It returns the following...&lt;BR /&gt;/dev/dsk/c7t0d1     /dev/dsk/c7t0d1s2   /dev/rdsk/c7t0d1    /dev/rdsk/c7t0d1s2&lt;BR /&gt;/dev/dsk/c7t0d1s1   /dev/dsk/c7t0d1s3   /dev/rdsk/c7t0d1s1  /dev/rdsk/c7t0d1s3&lt;BR /&gt;&lt;BR /&gt;I only want the first line, how do I do that?&lt;BR /&gt;&lt;BR /&gt;If I want only the second line, how do I do that?&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Mon, 06 Nov 2006 12:00:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/newbie-grep-question/m-p/5012406#M426746</guid>
      <dc:creator>Gene Laoyan</dc:creator>
      <dc:date>2006-11-06T12:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie grep question...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/newbie-grep-question/m-p/5012407#M426747</link>
      <description>ioscan -fnC disk | grep '/dev/rdsk/c7t0d1' |head -1&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Mon, 06 Nov 2006 12:04:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/newbie-grep-question/m-p/5012407#M426747</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2006-11-06T12:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie grep question...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/newbie-grep-question/m-p/5012408#M426748</link>
      <description>And for the last line:&lt;BR /&gt; ioscan -fnC disk | grep '/dev/rdsk/c7t0d1' |tail -1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;All the best&lt;BR /&gt;Victor</description>
      <pubDate>Mon, 06 Nov 2006 12:06:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/newbie-grep-question/m-p/5012408#M426748</guid>
      <dc:creator>Victor BERRIDGE</dc:creator>
      <dc:date>2006-11-06T12:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie grep question...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/newbie-grep-question/m-p/5012409#M426749</link>
      <description>If you want only 1st line use head:&lt;BR /&gt;&lt;BR /&gt;ioscan -fnC disk | grep '/dev/rdsk/c7t0d1' | head -n1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;ivan</description>
      <pubDate>Mon, 06 Nov 2006 12:07:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/newbie-grep-question/m-p/5012409#M426749</guid>
      <dc:creator>Ivan Krastev</dc:creator>
      <dc:date>2006-11-06T12:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie grep question...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/newbie-grep-question/m-p/5012410#M426750</link>
      <description>Or, for the second line,&lt;BR /&gt;&lt;BR /&gt; ioscan -fnC disk | grep '/dev/rdsk/c7t0d1' |head -2 |tail -1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Mon, 06 Nov 2006 12:07:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/newbie-grep-question/m-p/5012410#M426750</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2006-11-06T12:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie grep question...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/newbie-grep-question/m-p/5012411#M426751</link>
      <description>If you only want grep to return a line with the exact pattern you specified and no leading or trailing non-white characters you can use the -w argument.&lt;BR /&gt;&lt;BR /&gt;ioscan -fnC disk | grep -w '/dev/rdsk/c7t0d1'&lt;BR /&gt;&lt;BR /&gt;Your second question is a bit trickier. What would be your criteria for returning only the second line? The fact that it is second? The fact that it doesn't include the /dev/rdsk/c7t0d1 string except with additional characters at the end? The fact that it includes s1 and s3 and not s2?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 06 Nov 2006 12:08:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/newbie-grep-question/m-p/5012411#M426751</guid>
      <dc:creator>Jonathan Fife</dc:creator>
      <dc:date>2006-11-06T12:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie grep question...</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/newbie-grep-question/m-p/5012412#M426752</link>
      <description>Points awarded!&lt;BR /&gt;Thanks everyone!!!</description>
      <pubDate>Mon, 06 Nov 2006 12:29:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/newbie-grep-question/m-p/5012412#M426752</guid>
      <dc:creator>Gene Laoyan</dc:creator>
      <dc:date>2006-11-06T12:29:41Z</dc:date>
    </item>
  </channel>
</rss>

