<?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"
	>
<channel>
	<title>Comments on: What Chmod ? Symbolic to Octal Notation Perl Script</title>
	<atom:link href="http://planetozh.com/blog/2007/08/what-chmod-symbolic-to-octal-notation-perl-script/feed/" rel="self" type="application/rss+xml" />
	<link>http://planetozh.com/blog/2007/08/what-chmod-symbolic-to-octal-notation-perl-script/?source=rss</link>
	<description>A bit of my personal life, mainly focused on my kids. A bit of code, mainly focused on Wordpress and PHP. Overall, bits of nothing in particular.</description>
	<pubDate>Fri, 21 Nov 2008 13:35:26 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: hmpierson</title>
		<link>http://planetozh.com/blog/2007/08/what-chmod-symbolic-to-octal-notation-perl-script/#comment-52259</link>
		<dc:creator>hmpierson</dc:creator>
		<pubDate>Mon, 05 May 2008 00:43:22 +0000</pubDate>
		<guid isPermaLink="false">http://planetozh.com/blog/2007/08/what-chmod-symbolic-to-octal-notation-perl-script/#comment-52259</guid>
		<description>for 10 character strings like drwxrwxrwx:

[code]

  $_ = $ARGV[0];
  tr/rwx-/1110/;
   /^(.)(...)(...)(...)$/;
  $chmod =  oct("0b$2") . oct("0b$3") . oct("0b$4");

[/code]</description>
		<content:encoded><![CDATA[<p>for 10 character strings like drwxrwxrwx:</p>
<div class="igBar"><span id="lcode-1"><a href="#" onclick="javascript:showPlainTxt('code-1'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-1">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$_ = $ARGV<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; tr/rwx-/<span style="color:#800000;color:#800000;">1110</span>/;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;/^<span style="color:#006600; font-weight:bold;">&#40;</span>.<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#40;</span>...<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#40;</span>...<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#40;</span>...<span style="color:#006600; font-weight:bold;">&#41;</span>$/;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; $chmod =&nbsp; oct<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"0b$2"</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="">oct</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"0b$3"</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="">oct</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"0b$4"</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zundog</title>
		<link>http://planetozh.com/blog/2007/08/what-chmod-symbolic-to-octal-notation-perl-script/#comment-43058</link>
		<dc:creator>zundog</dc:creator>
		<pubDate>Mon, 17 Dec 2007 01:39:09 +0000</pubDate>
		<guid isPermaLink="false">http://planetozh.com/blog/2007/08/what-chmod-symbolic-to-octal-notation-perl-script/#comment-43058</guid>
		<description>#!/bin/bash

stat $1 &#124; sed -n -e 's&#124;Access: (\([0-7]\{4\}\).*&#124;\1&#124;p;d'

# why always use perl when you can do it simpler in bash ??? ;)</description>
		<content:encoded><![CDATA[<p>#!/bin/bash</p>
<p>stat $1 | sed -n -e 's|Access: (\([0-7]\{4\}\).*|\1|p;d'</p>
<p># why always use perl when you can do it simpler in bash ??? ;)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
