<?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: awk question regarding /[:space:]/ and REs in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-question-regarding-space-and-res/m-p/2585218#M856199</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;to get it work only a little correction is needed, try:&lt;BR /&gt;&lt;BR /&gt;cat FILE |awk ' /^[[:space:]]*--/ {printf "%6d: %s\n", NR, $0}' &lt;BR /&gt;&lt;BR /&gt;(Note the [[ and ]])&lt;BR /&gt;&lt;BR /&gt;Regards</description>
    <pubDate>Wed, 26 Sep 2001 12:31:12 GMT</pubDate>
    <dc:creator>Andreas Voss</dc:creator>
    <dc:date>2001-09-26T12:31:12Z</dc:date>
    <item>
      <title>awk question regarding /[:space:]/ and REs</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-question-regarding-space-and-res/m-p/2585215#M856196</link>
      <description>I am trying to use awk to (amongst other things) trap lines beginning with "--" (2 dashes). Whitespace in the form of tabs/spaces (sometimes mixed) may precede the "--".&lt;BR /&gt;(Yes, I am preprocessing Oracle PL/SQL code).&lt;BR /&gt;&lt;BR /&gt;I am using&lt;BR /&gt;cat FILE |awk ' /^[:space:]*--/ {printf "%6d: %s\n", NR, $0}'&lt;BR /&gt;but it only detects lines beginning with "--", those with preceding whitespace are missed.&lt;BR /&gt;I know I could use something like&lt;BR /&gt;  /^--/||/^ *--/||/^\t*--/ &lt;BR /&gt;for my pattern, but this still does not pick up the arbitrary mixes of spaces and tabs so beloved of my developer community.&lt;BR /&gt;&lt;BR /&gt;grep -n "^[:space:]*--" FILE does the same.&lt;BR /&gt;&lt;BR /&gt;Ideas anyone ?&lt;BR /&gt;&lt;BR /&gt;Graham&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Sep 2001 11:41:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-question-regarding-space-and-res/m-p/2585215#M856196</guid>
      <dc:creator>Graham Cameron_1</dc:creator>
      <dc:date>2001-09-26T11:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: awk question regarding /[:space:]/ and REs</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-question-regarding-space-and-res/m-p/2585216#M856197</link>
      <description>Hi Graham:&lt;BR /&gt;&lt;BR /&gt;Try filtering out the whitespace before, as:&lt;BR /&gt;&lt;BR /&gt;cat FILE | sed 's/[  ]*//' | awk ' /--/ {printf "%6d: %s\n", NR, $0}'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF... &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Sep 2001 12:11:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-question-regarding-space-and-res/m-p/2585216#M856197</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-09-26T12:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: awk question regarding /[:space:]/ and REs</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-question-regarding-space-and-res/m-p/2585217#M856198</link>
      <description>Hi (again) Graham:&lt;BR /&gt;&lt;BR /&gt;I should add, perhaps obviously (?) that inside the "[ ]" expression to 'sed' is a 'space' and a 'tab' character.  That is, type '[', 'space', 'tab', ']'.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Sep 2001 12:14:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-question-regarding-space-and-res/m-p/2585217#M856198</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-09-26T12:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: awk question regarding /[:space:]/ and REs</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-question-regarding-space-and-res/m-p/2585218#M856199</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;to get it work only a little correction is needed, try:&lt;BR /&gt;&lt;BR /&gt;cat FILE |awk ' /^[[:space:]]*--/ {printf "%6d: %s\n", NR, $0}' &lt;BR /&gt;&lt;BR /&gt;(Note the [[ and ]])&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Wed, 26 Sep 2001 12:31:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-question-regarding-space-and-res/m-p/2585218#M856199</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2001-09-26T12:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: awk question regarding /[:space:]/ and REs</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-question-regarding-space-and-res/m-p/2585219#M856200</link>
      <description>Hi Graham,&lt;BR /&gt;&lt;BR /&gt;character classes require *double* square brackets, e.g.&lt;BR /&gt;&lt;BR /&gt;cat /tmp/file |awk ' /^[[:space:]]*--/ {printf "%6d: %s\n", NR, $0}'&lt;BR /&gt;     1: -- abc&lt;BR /&gt;     2:   -- def&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin</description>
      <pubDate>Wed, 26 Sep 2001 12:36:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-question-regarding-space-and-res/m-p/2585219#M856200</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2001-09-26T12:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: awk question regarding /[:space:]/ and REs</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-question-regarding-space-and-res/m-p/2585220#M856201</link>
      <description>Andreas, Robin&lt;BR /&gt;&lt;BR /&gt;Brilliant !&lt;BR /&gt;Thanks.</description>
      <pubDate>Wed, 26 Sep 2001 12:37:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-question-regarding-space-and-res/m-p/2585220#M856201</guid>
      <dc:creator>Graham Cameron_1</dc:creator>
      <dc:date>2001-09-26T12:37:55Z</dc:date>
    </item>
  </channel>
</rss>

