<?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 分割字符串存至数组及shell查找某个字符串是否存在的方法，Shell获取字符串的MD5]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Php/Js/Shell/Go]]></category>
<pubDate>Tue, 24 Jul 2012 12:18:57 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	http://www.cnblogs.com/chengmo/archive/2010/09/30/1839632.html<br/><br/>1）shell 分割字符串存至数组<br/><textarea name="code" class="python" rows="15" cols="100">
a=&quot;one;two;three;four&quot;
OLD_IFS=&quot;$IFS&quot;
IFS=&quot;;&quot;
arr=($a)
IFS=&quot;$OLD_IFS&quot;
for s in $&#123;arr[@]&#125;
do
echo &quot;$s&quot;
done

</textarea><br/><br/><br/>上述代码会输出<br/>one<br/>two<br/>three<br/>four<br/><br/>arr=($a)用于将字符串$a分割到数组$arr $&#123;arr[0]&#125; $&#123;arr[1]&#125; ... 分别存储分割后的数组第1 2 ... 项 ，$&#123;arr[@]&#125;存储整个数组。变量$IFS存储着分隔符，这里我们将其设为分号 &quot;,&quot; OLD_IFS用于备份默认的分隔符，使用完后将之恢复默认。<br/><br/>2）shell查找某个字符串是否存在的方法：<br/><textarea name="code" class="php" rows="15" cols="100">
str=&quot;/tmp/jack/tmp/xiang&quot;
ok=`echo $&#123;str&#125; &#124;grep &quot;;&quot;&#124;wc -l`
echo $ok
</textarea><br/><br/>存在ok值为1，不存在则为0.<br/><br/><br/><br/>$&#123;desturlLoopPath&#125;<br/><br/><br/>Shell获取字符串的MD5:<br/>echo -n &#039;hello&#039;&#124;md5sum&#124;cut -d &#039; &#039; -f1<br/>命令解释：<br/>md5sum: 显示或检查 MD5(128-bit) 校验和,若没有文件选项，或者文件处为&quot;-&quot;，则从标准输入读取。<br/>echo -n : 不打印换行符。<br/>cut:&nbsp;&nbsp;cut用来从标准输入或文本文件中剪切列或域。剪切文本可以将之粘贴到一个文本文件。 <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-d 指定与空格和tab键不同的域分隔符。-f1 表示第一个域。参考这里。<br/>
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] shell 分割字符串存至数组及shell查找某个字符串是否存在的方法，Shell获取字符串的MD5]]></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>