<?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 stumper in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-stumper/m-p/2776979#M722415</link>
    <description>This is the output from the command.&lt;BR /&gt;&lt;BR /&gt;:u_unsuclog#1026418505:u_unsuctty=console:u_maxtries#9:u_lock@:&lt;BR /&gt;I want to be able to determine the field that u_maxtries is in and then do my substitution from that.&lt;BR /&gt;&lt;BR /&gt;Yes I know the sub() function, I can't get it to work the way I want it to...&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 31 Jul 2002 19:26:43 GMT</pubDate>
    <dc:creator>Craig Rants</dc:creator>
    <dc:date>2002-07-31T19:26:43Z</dc:date>
    <item>
      <title>awk stumper</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-stumper/m-p/2776975#M722411</link>
      <description>I am trying to perform a task in awk and have run into a block wall. (Any responses on how to do this in sed will get negative points, I can already do it sed...)&lt;BR /&gt;&lt;BR /&gt;I want to be able to find my string in a file, then use the field number as a basis for my subsitition.  I have the my command for matching, but I can't get the sub to work.  Any help would be appreciated.&lt;BR /&gt;&lt;BR /&gt;awk 'match($0,"u_maxtries"){FS=":";print substr ($0,0)}' root&lt;BR /&gt;&lt;BR /&gt;Craig</description>
      <pubDate>Wed, 31 Jul 2002 18:20:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-stumper/m-p/2776975#M722411</guid>
      <dc:creator>Craig Rants</dc:creator>
      <dc:date>2002-07-31T18:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: awk stumper</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-stumper/m-p/2776976#M722412</link>
      <description>hi&lt;BR /&gt;&lt;BR /&gt;I'm not an awk freak so the chance is big i'm&lt;BR /&gt;wrong but substr doesnt do a substitution i&lt;BR /&gt;think. It is the function sub that can do &lt;BR /&gt;this. &lt;BR /&gt;&lt;BR /&gt;you can also use awk '/pattern/' file to&lt;BR /&gt;find a string.&lt;BR /&gt;&lt;BR /&gt;rgds.&lt;BR /&gt;&lt;BR /&gt;STeven</description>
      <pubDate>Wed, 31 Jul 2002 18:34:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-stumper/m-p/2776976#M722412</guid>
      <dc:creator>Steven Mertens</dc:creator>
      <dc:date>2002-07-31T18:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: awk stumper</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-stumper/m-p/2776977#M722413</link>
      <description>Craig,&lt;BR /&gt;&lt;BR /&gt;Can you give us an example of your input line and its associated output line?&lt;BR /&gt;&lt;BR /&gt;Hai</description>
      <pubDate>Wed, 31 Jul 2002 18:56:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-stumper/m-p/2776977#M722413</guid>
      <dc:creator>Hai Nguyen_1</dc:creator>
      <dc:date>2002-07-31T18:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: awk stumper</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-stumper/m-p/2776978#M722414</link>
      <description>&lt;BR /&gt;maybe that will do it ? :&lt;BR /&gt;&lt;BR /&gt;awk 'match($0,"u_maxtries"){FS=":";sub($0,0); print'} root&lt;BR /&gt;&lt;BR /&gt;but it will replace the whole line that&lt;BR /&gt;contains the word u_maxtries in 0</description>
      <pubDate>Wed, 31 Jul 2002 18:57:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-stumper/m-p/2776978#M722414</guid>
      <dc:creator>Steven Mertens</dc:creator>
      <dc:date>2002-07-31T18:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: awk stumper</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-stumper/m-p/2776979#M722415</link>
      <description>This is the output from the command.&lt;BR /&gt;&lt;BR /&gt;:u_unsuclog#1026418505:u_unsuctty=console:u_maxtries#9:u_lock@:&lt;BR /&gt;I want to be able to determine the field that u_maxtries is in and then do my substitution from that.&lt;BR /&gt;&lt;BR /&gt;Yes I know the sub() function, I can't get it to work the way I want it to...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 31 Jul 2002 19:26:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-stumper/m-p/2776979#M722415</guid>
      <dc:creator>Craig Rants</dc:creator>
      <dc:date>2002-07-31T19:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: awk stumper</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-stumper/m-p/2776980#M722416</link>
      <description>What is supposted to be substituted in your output line?&lt;BR /&gt;&lt;BR /&gt;Hai</description>
      <pubDate>Wed, 31 Jul 2002 19:31:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-stumper/m-p/2776980#M722416</guid>
      <dc:creator>Hai Nguyen_1</dc:creator>
      <dc:date>2002-07-31T19:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: awk stumper</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-stumper/m-p/2776981#M722417</link>
      <description>next try :)&lt;BR /&gt;&lt;BR /&gt;awk '{FS=":";sub("u_maxtries","0"); print'} root&lt;BR /&gt;&lt;BR /&gt;Steven</description>
      <pubDate>Wed, 31 Jul 2002 19:35:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-stumper/m-p/2776981#M722417</guid>
      <dc:creator>Steven Mertens</dc:creator>
      <dc:date>2002-07-31T19:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: awk stumper</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-stumper/m-p/2776982#M722418</link>
      <description>Steven, don't know what I was fat fingering, but here's what i did to sub for the entire field.&lt;BR /&gt;&lt;BR /&gt;awk '{FS=":";sub("u_maxtries#[0-9]*","u_maxtries#6");print'} root&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Craig</description>
      <pubDate>Wed, 31 Jul 2002 19:44:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-stumper/m-p/2776982#M722418</guid>
      <dc:creator>Craig Rants</dc:creator>
      <dc:date>2002-07-31T19:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: awk stumper</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-stumper/m-p/2776983#M722419</link>
      <description>I wish I had time to write some code but I don't - however if you need to know the field number of a match, you could use the for loop in awk to loop thru each field looking for the match.&lt;BR /&gt;&lt;BR /&gt;Basically:&lt;BR /&gt;&lt;BR /&gt;  for (field=1;field&amp;lt;=NF;field++)&lt;BR /&gt;&lt;BR /&gt;If theres's a match during the looping, the variable "field" gives you the field number.&lt;BR /&gt;</description>
      <pubDate>Thu, 01 Aug 2002 12:25:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-stumper/m-p/2776983#M722419</guid>
      <dc:creator>Fred Martin_1</dc:creator>
      <dc:date>2002-08-01T12:25:37Z</dc:date>
    </item>
  </channel>
</rss>

