<?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>Tuts4Tech &#187; check</title>
	<atom:link href="http://tuts4tech.net/tag/check/feed/" rel="self" type="application/rss+xml" />
	<link>http://tuts4tech.net</link>
	<description>Tech Tutorials</description>
	<lastBuildDate>Tue, 04 May 2010 20:35:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Nano write check before editing</title>
		<link>http://tuts4tech.net/2009/07/08/nano-write-check-before-editing/</link>
		<comments>http://tuts4tech.net/2009/07/08/nano-write-check-before-editing/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 18:29:35 +0000</pubDate>
		<dc:creator>Duffy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[check]]></category>
		<category><![CDATA[configurations]]></category>
		<category><![CDATA[nano]]></category>
		<category><![CDATA[premissions]]></category>
		<category><![CDATA[read]]></category>
		<category><![CDATA[sudo]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[users]]></category>
		<category><![CDATA[wheel]]></category>
		<category><![CDATA[write]]></category>

		<guid isPermaLink="false">http://tuts4tech.net/?p=463</guid>
		<description><![CDATA[Have you ever been using nano to edit a long configuration file and when you've just finished you go to save and you get "Error writing /dir/somefile: Permission denied" as you've forgotten to use sudo or switch user if so this tutorial might just be your solution. What this does is it runs a script [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever been using nano to edit a long configuration file and when you've just finished you go to save and you get "Error writing /dir/somefile: Permission denied" as you've forgotten to use sudo or switch user if so this tutorial might just be your solution. What this does is it runs a script to check if you have write access on the file if you do it will continue and open nano as normal if you don't it will ask you do you want to continue so lets get started</p>
<ol>
<li>Save the following to /usr/bin/writecheck
<pre class="brush: bash; title: ; notranslate">#!/bin/bash
FILE=&quot;$1&quot;

[ $# -eq 0 ] &amp;&amp; exit 1

if [ -w &quot;$FILE&quot; ]
then
nano $FILE
else
   echo &quot;You Do Not Have Write Acess To $FILE&quot;
   echo -n &quot;Do You Want To Continue (y/n)?&quot;
   read reply
   [ $reply == &quot;y&quot; ] &amp;&amp; nano $FILE
fi</pre>
</li>
<li>Allow the script to be executed
<pre class="brush: bash; title: ; notranslate">chmod +x /usr/bin/writecheck</pre>
</li>
<li>Finally we need to add a alias for it
<pre class="brush: bash; title: ; notranslate">echo &quot;alias nano='writecheck'&quot; &gt;&gt; /etc/bash.bashrc</pre>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://tuts4tech.net/2009/07/08/nano-write-check-before-editing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

