<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[shell脚本中判断变量文件目录：权限、是否存在、空值、相等]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Thu, 11 Sep 2008 02:44:27 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	-f file　　　　　文件为正规文件为真<br/>-s file　　　　　文件大小非0时为真　　　　-s file true if the file has nonzero size<br/><textarea name="code" class="php" rows="15" cols="100">
if [ -f $PIDFILE&nbsp;&nbsp;] &amp;&amp; [ -s $PIDFILE ]; then
</textarea><br/><br/><div class="code">#!/bin/sh<br/>myPath=&quot;/var/log/httpd/&quot;<br/>myFile=&quot;/var /log/httpd/access.log&quot;</div><br/><br/>#这里的-x 参数判断$myPath是否存在并且是否具有可执行权限<br/><br/><div class="code">if &#91; ! -x &quot;$myPath&quot;&#93;; then<br/>mkdir &quot;$myPath&quot;<br/>fi</div><br/>#这里的-d 参数判断$myPath是否存在<br/><br/><div class="code">if &#91; ! -d &quot;$myPath&quot;&#93;; then<br/>mkdir &quot;$myPath&quot;<br/>fi</div><br/>#这里的-f参数判断$myFile是否存在<br/><br/><div class="code">if &#91; ! -f &quot;$myFile&quot; &#93;; then<br/>touch &quot;$myFile&quot;<br/>fi</div><br/><br/>#其他参数还有-n,-n是判断一个变量是否是否有值<br/><br/><div class="code">if &#91; ! -n &quot;$myVar&quot; &#93;; then<br/>echo &quot;$myVar is empty&quot;<br/>exit 0<br/>fi</div><br/><br/>#两个变量判断是否相等<br/><br/><div class="code">if &#91; &quot;$var1&quot; == &quot;$var2&quot; &#93;; then<br/>echo &#039;$var1 eq $var2&#039;<br/>else<br/>echo &#039;$var1 not eq $var2&#039;<br/>fi</div>
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] shell脚本中判断变量文件目录：权限、是否存在、空值、相等]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>