<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Prepend text to a file</title>
	<atom:link href="http://osxdaily.com/2010/10/07/prepend-text-to-a-file/feed/" rel="self" type="application/rss+xml" />
	<link>http://osxdaily.com/2010/10/07/prepend-text-to-a-file/</link>
	<description>News, tips, software, reviews, and more for Mac OS X, iPhone, iPad</description>
	<lastBuildDate>Sun, 19 May 2013 18:30:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Pete</title>
		<link>http://osxdaily.com/2010/10/07/prepend-text-to-a-file/#comment-122039</link>
		<dc:creator>Pete</dc:creator>
		<pubDate>Fri, 08 Oct 2010 06:54:53 +0000</pubDate>
		<guid isPermaLink="false">http://osxdaily.com/?p=8183#comment-122039</guid>
		<description>Both of these are risky - if you screw it up, you end up trashing your original file.

Not only does the 2nd version work in all UNIXes, but it probably works better if file.txt is a huge (many megabytes) text file.

This may be even better:

     sed -i.bak -e &#039;1i\                 
     Hello there&#039; x.pl

This way, at least you keep a backup, just in case.</description>
		<content:encoded><![CDATA[<p>Both of these are risky &#8211; if you screw it up, you end up trashing your original file.</p>
<p>Not only does the 2nd version work in all UNIXes, but it probably works better if file.txt is a huge (many megabytes) text file.</p>
<p>This may be even better:</p>
<p>     sed -i.bak -e &#8217;1i\<br />
     Hello there&#8217; x.pl</p>
<p>This way, at least you keep a backup, just in case.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lar3ry</title>
		<link>http://osxdaily.com/2010/10/07/prepend-text-to-a-file/#comment-121848</link>
		<dc:creator>lar3ry</dc:creator>
		<pubDate>Thu, 07 Oct 2010 19:25:23 +0000</pubDate>
		<guid isPermaLink="false">http://osxdaily.com/?p=8183#comment-121848</guid>
		<description>You&#039;re trying too hard...

(echo &quot;Text to prepend&quot;; cat file.txt) &gt; /tmp/tempfile &amp;&amp; mv /tmp/tempfile file.txt</description>
		<content:encoded><![CDATA[<p>You&#8217;re trying too hard&#8230;</p>
<p>(echo &#8220;Text to prepend&#8221;; cat file.txt) &gt; /tmp/tempfile &amp;&amp; mv /tmp/tempfile file.txt</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced (User agent is rejected)
Database Caching 1/3 queries in 0.002 seconds using disk: basic
Object Caching 200/201 objects using disk: basic
Content Delivery Network via cdn.osxdaily.com

Served from: osxdaily.com @ 2013-05-19 14:50:54 -->