<?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: Inserting a line on top file. in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/inserting-a-line-on-top-file/m-p/5151981#M50277</link>
    <description>Another, non-perlish, solution would be to just recreate the file.&lt;BR /&gt;&lt;BR /&gt;echo "what-you-want-the-top-line(s)-to-contain" &amp;gt; tmp.file&lt;BR /&gt;cat orig.file &amp;gt;&amp;gt; tmp.file&lt;BR /&gt;mv tmp.file orig.file&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Fredrik Eriksson</description>
    <pubDate>Thu, 22 Jan 2009 15:21:53 GMT</pubDate>
    <dc:creator>Fredrik.eriksson</dc:creator>
    <dc:date>2009-01-22T15:21:53Z</dc:date>
    <item>
      <title>Inserting a line on top file.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/inserting-a-line-on-top-file/m-p/5151977#M50273</link>
      <description>Hi Guys&lt;BR /&gt;&lt;BR /&gt;How to insert a new line with text at the beginning of a text file ? &lt;BR /&gt;&lt;BR /&gt;Bests Regards&lt;BR /&gt;Den</description>
      <pubDate>Thu, 22 Jan 2009 15:06:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/inserting-a-line-on-top-file/m-p/5151977#M50273</guid>
      <dc:creator>Leo The Cat</dc:creator>
      <dc:date>2009-01-22T15:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting a line on top file.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/inserting-a-line-on-top-file/m-p/5151978#M50274</link>
      <description>Hi Den:&lt;BR /&gt;&lt;BR /&gt;This will perform an "in-place" update:&lt;BR /&gt;&lt;BR /&gt;# perl -pli -e '$.==1 and print "INSERTED"' file&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 22 Jan 2009 15:16:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/inserting-a-line-on-top-file/m-p/5151978#M50274</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-01-22T15:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting a line on top file.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/inserting-a-line-on-top-file/m-p/5151979#M50275</link>
      <description>Assuming that you are talking about scripting,&lt;BR /&gt;Maybe something lke this:&lt;BR /&gt;&lt;BR /&gt;file.txt : the file without the the new header file&lt;BR /&gt;head.txt : a file with the line to be inserted in top.&lt;BR /&gt;&lt;BR /&gt;mv file.txt file.txt.old&lt;BR /&gt;cat head.txt file.txt.old &amp;gt; file.txt&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Jan 2009 15:20:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/inserting-a-line-on-top-file/m-p/5151979#M50275</guid>
      <dc:creator>Shoghi Martinez G.</dc:creator>
      <dc:date>2009-01-22T15:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting a line on top file.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/inserting-a-line-on-top-file/m-p/5151980#M50276</link>
      <description>Thanks James, &lt;BR /&gt;That's do the trick !&lt;BR /&gt;&lt;BR /&gt;Bests Regards&lt;BR /&gt;Den</description>
      <pubDate>Thu, 22 Jan 2009 15:21:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/inserting-a-line-on-top-file/m-p/5151980#M50276</guid>
      <dc:creator>Leo The Cat</dc:creator>
      <dc:date>2009-01-22T15:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting a line on top file.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/inserting-a-line-on-top-file/m-p/5151981#M50277</link>
      <description>Another, non-perlish, solution would be to just recreate the file.&lt;BR /&gt;&lt;BR /&gt;echo "what-you-want-the-top-line(s)-to-contain" &amp;gt; tmp.file&lt;BR /&gt;cat orig.file &amp;gt;&amp;gt; tmp.file&lt;BR /&gt;mv tmp.file orig.file&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Fredrik Eriksson</description>
      <pubDate>Thu, 22 Jan 2009 15:21:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/inserting-a-line-on-top-file/m-p/5151981#M50277</guid>
      <dc:creator>Fredrik.eriksson</dc:creator>
      <dc:date>2009-01-22T15:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting a line on top file.</title>
      <link>https://community.hpe.com/t5/operating-system-linux/inserting-a-line-on-top-file/m-p/5151982#M50278</link>
      <description>You can also use sed:&lt;BR /&gt;sed '&lt;BR /&gt;1i\&lt;BR /&gt;line&lt;BR /&gt;' file &amp;gt; file.new</description>
      <pubDate>Sun, 25 Jan 2009 08:02:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/inserting-a-line-on-top-file/m-p/5151982#M50278</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-01-25T08:02:24Z</dc:date>
    </item>
  </channel>
</rss>

