<?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 a specific line in a file? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-specific-line-in-a-file/m-p/2805972#M939601</link>
    <description>Hi Russ:&lt;BR /&gt;&lt;BR /&gt;Try:&lt;BR /&gt;&lt;BR /&gt;# sed -e 40's/.*/new stuff on line/' filein &amp;gt; fileout&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Fri, 13 Sep 2002 13:11:31 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2002-09-13T13:11:31Z</dc:date>
    <item>
      <title>replace a specific line in a file?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-specific-line-in-a-file/m-p/2805969#M939598</link>
      <description>Anyone know how to replace an entire line ( say line 40 ) with a complete new line ?!&lt;BR /&gt;&lt;BR /&gt;The line to be replaced will not have the same content everytime, but the line number will be constant....&lt;BR /&gt;&lt;BR /&gt;Thanks again(!)&lt;BR /&gt;Russ.</description>
      <pubDate>Fri, 13 Sep 2002 13:01:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-specific-line-in-a-file/m-p/2805969#M939598</guid>
      <dc:creator>Russ Hancock_1</dc:creator>
      <dc:date>2002-09-13T13:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: replace a specific line in a file?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-specific-line-in-a-file/m-p/2805970#M939599</link>
      <description>In a script?&lt;BR /&gt;&lt;BR /&gt;ed filename &amp;lt;&lt;EOI&gt;&lt;/EOI&gt;40s/^.*$/New Content/&lt;BR /&gt;w&lt;BR /&gt;q&lt;BR /&gt;EOI&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Heiner</description>
      <pubDate>Fri, 13 Sep 2002 13:06:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-specific-line-in-a-file/m-p/2805970#M939599</guid>
      <dc:creator>Heiner E. Lennackers</dc:creator>
      <dc:date>2002-09-13T13:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: replace a specific line in a file?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-specific-line-in-a-file/m-p/2805971#M939600</link>
      <description>Russ,&lt;BR /&gt;&lt;BR /&gt;On quick review I didn't see the exact solution you're looking for, but I'm attaching the "Handy One-liners for Sed" for your future reference (orginally courtesy of Princess Paula).&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Fri, 13 Sep 2002 13:11:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-specific-line-in-a-file/m-p/2805971#M939600</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2002-09-13T13:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: replace a specific line in a file?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-specific-line-in-a-file/m-p/2805972#M939601</link>
      <description>Hi Russ:&lt;BR /&gt;&lt;BR /&gt;Try:&lt;BR /&gt;&lt;BR /&gt;# sed -e 40's/.*/new stuff on line/' filein &amp;gt; fileout&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 13 Sep 2002 13:11:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-specific-line-in-a-file/m-p/2805972#M939601</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-09-13T13:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: replace a specific line in a file?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-specific-line-in-a-file/m-p/2805973#M939602</link>
      <description>Hi&lt;BR /&gt;something like this&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;rep_line "YOUR NEW LINE" &lt;FILE1&gt;file2&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;newline=$1&lt;BR /&gt;let line=1&lt;BR /&gt;while read line&lt;BR /&gt;do&lt;BR /&gt;if [ $line -eq 40 ]&lt;BR /&gt;then &lt;BR /&gt;echo $newline&lt;BR /&gt;else&lt;BR /&gt;echo $line&lt;BR /&gt;fi&lt;BR /&gt;let line =$line + 1&lt;BR /&gt;done&lt;BR /&gt;&lt;/FILE1&gt;</description>
      <pubDate>Fri, 13 Sep 2002 13:12:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-specific-line-in-a-file/m-p/2805973#M939602</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2002-09-13T13:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: replace a specific line in a file?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-specific-line-in-a-file/m-p/2805974#M939603</link>
      <description>sorry, line counter got wrong.&lt;BR /&gt;&lt;BR /&gt;Hi &lt;BR /&gt;something like this &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;rep_line "YOUR NEW LINE" &lt;FILE1&gt;file2 &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;newline=$1 &lt;BR /&gt;let n=1 &lt;BR /&gt;while read line &lt;BR /&gt;do &lt;BR /&gt;if [ $n -eq 40 ] &lt;BR /&gt;then &lt;BR /&gt;echo $newline &lt;BR /&gt;else &lt;BR /&gt;echo $line &lt;BR /&gt;fi &lt;BR /&gt;let n =$n + 1 &lt;BR /&gt;done &lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;/FILE1&gt;</description>
      <pubDate>Fri, 13 Sep 2002 13:15:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-specific-line-in-a-file/m-p/2805974#M939603</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2002-09-13T13:15:18Z</dc:date>
    </item>
  </channel>
</rss>

