<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TLF Blog &#187; Shell Programming</title>
	<atom:link href="http://thelinuxfix.com/blog/category/shell-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://thelinuxfix.com/blog</link>
	<description>Hosting, Unix, and everything in between.</description>
	<lastBuildDate>Mon, 30 Jan 2012 19:34:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Adding a line to the beginning of a file in Unix/Linux</title>
		<link>http://thelinuxfix.com/blog/2009/05/11/adding-a-line-to-the-beginning-of-a-file-in-unixlinux/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=adding-a-line-to-the-beginning-of-a-file-in-unixlinux</link>
		<comments>http://thelinuxfix.com/blog/2009/05/11/adding-a-line-to-the-beginning-of-a-file-in-unixlinux/#comments</comments>
		<pubDate>Mon, 11 May 2009 20:38:46 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Shell Programming]]></category>

		<guid isPermaLink="false">http://thelinuxfix.com/blog/?p=118</guid>
		<description><![CDATA[This morning someone asked me how to do a relatively simple operation from a Unix shell: Adding a line of text to the beginning of a file. Much to my surprise he asked for help with amazingly complex methods he had tried. Okay everyone, no need to hit this thumbtack with a sledgehammer!  Let’s say you have a [...]]]></description>
			<content:encoded><![CDATA[<p>This morning someone asked me how to do a relatively simple operation from a Unix shell: <strong>Adding a line of text to the beginning of a file.</strong></p>
<p>Much to my surprise he asked for help with <a href="http://archives.devshed.com/forums/unix-linux-135/insert-line-in-the-first-line-372253.html">amazingly complex methods</a> he had tried.</p>
<p>Okay everyone, no need to hit this thumbtack with a sledgehammer!  Let’s say you have a file “textfile.txt” and want to put “&lt;Header&gt;” on the top:</p>
<p>echo -e “&lt;Header&gt;\n$(cat textfile.txt)” &gt; textfile.txt</p>
<p>There you go, nice and simple.</p>
]]></content:encoded>
			<wfw:commentRss>http://thelinuxfix.com/blog/2009/05/11/adding-a-line-to-the-beginning-of-a-file-in-unixlinux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

