<?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: replace $2 using sed in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-2-using-sed/m-p/5168212#M681753</link>
    <description>lawrenzo&lt;BR /&gt;by $2 , you mean second column ?</description>
    <pubDate>Mon, 06 Apr 2009 13:34:54 GMT</pubDate>
    <dc:creator>RUET</dc:creator>
    <dc:date>2009-04-06T13:34:54Z</dc:date>
    <item>
      <title>replace $2 using sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-2-using-sed/m-p/5168211#M681752</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;is it possible to change the value of $2 using sed?&lt;BR /&gt;&lt;BR /&gt;ie&lt;BR /&gt;&lt;BR /&gt;MGTSYS=myserver&lt;BR /&gt;&lt;BR /&gt;sed -e "/^server/ s/$2/${MGTSYS}/" etc/ntp.conf&lt;BR /&gt;&lt;BR /&gt;??&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Chris.</description>
      <pubDate>Mon, 06 Apr 2009 13:28:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-2-using-sed/m-p/5168211#M681752</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2009-04-06T13:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: replace $2 using sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-2-using-sed/m-p/5168212#M681753</link>
      <description>lawrenzo&lt;BR /&gt;by $2 , you mean second column ?</description>
      <pubDate>Mon, 06 Apr 2009 13:34:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-2-using-sed/m-p/5168212#M681753</guid>
      <dc:creator>RUET</dc:creator>
      <dc:date>2009-04-06T13:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: replace $2 using sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-2-using-sed/m-p/5168213#M681754</link>
      <description>awk -F " " '/^server/ {$2="myserver";print }' ntp.conf</description>
      <pubDate>Mon, 06 Apr 2009 13:38:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-2-using-sed/m-p/5168213#M681754</guid>
      <dc:creator>T G Manikandan</dc:creator>
      <dc:date>2009-04-06T13:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: replace $2 using sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-2-using-sed/m-p/5168214#M681755</link>
      <description>Hi Chris:&lt;BR /&gt;&lt;BR /&gt;I suspect you mean:&lt;BR /&gt;&lt;BR /&gt;# sed -e "s/\(server \)\(.*\)/\1${MGTSYS}/" /etc/ntp.conf&lt;BR /&gt;&lt;BR /&gt;...as to change lines like:&lt;BR /&gt;&lt;BR /&gt;server chris.xyz.com&lt;BR /&gt;&lt;BR /&gt;to:&lt;BR /&gt;&lt;BR /&gt;server lawrenzo.xyz.com&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 06 Apr 2009 13:46:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-2-using-sed/m-p/5168214#M681755</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-04-06T13:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: replace $2 using sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-2-using-sed/m-p/5168215#M681756</link>
      <description>if you really want sed :&lt;BR /&gt;&lt;BR /&gt; cat  ntp.conf| sed "/^server/s/\(server\) \(.*\)/\1 ${MGTSYS}/"</description>
      <pubDate>Mon, 06 Apr 2009 14:07:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-2-using-sed/m-p/5168215#M681756</guid>
      <dc:creator>RUET</dc:creator>
      <dc:date>2009-04-06T14:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: replace $2 using sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-2-using-sed/m-p/5168216#M681757</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; P.R. if you really want sed :&lt;BR /&gt;&lt;BR /&gt;The 'cat' is useless overhead.  Sed is quite capable of reading a file from the command line.  You only added a useless process and an additional read and write of the input file into a pipe!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 06 Apr 2009 14:13:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-2-using-sed/m-p/5168216#M681757</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-04-06T14:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: replace $2 using sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-2-using-sed/m-p/5168217#M681758</link>
      <description>James&lt;BR /&gt;&lt;BR /&gt;yes of course cat is not mandatory .. it was just a way of do it .. &lt;BR /&gt;you are right , sed can do the job alone ..&lt;BR /&gt;&lt;BR /&gt;pat</description>
      <pubDate>Mon, 06 Apr 2009 14:20:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-2-using-sed/m-p/5168217#M681758</guid>
      <dc:creator>RUET</dc:creator>
      <dc:date>2009-04-06T14:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: replace $2 using sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-2-using-sed/m-p/5168218#M681759</link>
      <description>ok got that - quite complex answers but something I can work with.&lt;BR /&gt;&lt;BR /&gt;Thanks all &lt;BR /&gt;&lt;BR /&gt;Chris.</description>
      <pubDate>Mon, 06 Apr 2009 14:28:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-2-using-sed/m-p/5168218#M681759</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2009-04-06T14:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: replace $2 using sed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-2-using-sed/m-p/5168219#M681760</link>
      <description>ty.</description>
      <pubDate>Mon, 06 Apr 2009 14:29:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-2-using-sed/m-p/5168219#M681760</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2009-04-06T14:29:12Z</dc:date>
    </item>
  </channel>
</rss>

