<?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>可可熊的窝 &#187; Shell</title>
	<atom:link href="http://cocobear.info/blog/tag/shell/feed/" rel="self" type="application/rss+xml" />
	<link>http://cocobear.info/blog</link>
	<description>K.I.S.S</description>
	<lastBuildDate>Sun, 11 Mar 2012 14:04:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>shell脚本解题6</title>
		<link>http://cocobear.info/blog/2008/08/19/07-issues-shell/</link>
		<comments>http://cocobear.info/blog/2008/08/19/07-issues-shell/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 07:42:19 +0000</pubDate>
		<dc:creator>可可熊</dc:creator>
				<category><![CDATA[Shell]]></category>
		<category><![CDATA[编程相关]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://cocobear.info/blog/?p=297</guid>
		<description><![CDATA[问题：
执行命令前暂时回home目录，执行后跳回来

<strong>解法：
1.</strong>
[bash] (cd ~; ls; )[/bash]
使用子shell的方式去执行命令；

把这行
gs.AddMany(  [b_cls,b_bck,t_blank,b_close,b_7,b_8,b_9,b_d[......]<p class='read-more'><a href='http://cocobear.info/blog/2008/08/19/07-issues-shell/'>阅读全文内容</a></p>]]></description>
		<wfw:commentRss>http://cocobear.info/blog/2008/08/19/07-issues-shell/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>处理了下网站</title>
		<link>http://cocobear.info/blog/2008/08/15/deal-with-wes/</link>
		<comments>http://cocobear.info/blog/2008/08/15/deal-with-wes/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 09:57:53 +0000</pubDate>
		<dc:creator>可可熊</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://cocobear.info/blog/?p=305</guid>
		<description><![CDATA[改了info域名后网站以前里很多页面里有cocobear.cn，连一些图片也显示不出来，今天就处理了一下：

把网站里一些文件做替换，先备份一下：
grep cocobear.cn ./cocobear.info/ -R -l --binary-files=without-match&#124;xarg[......]<p class='read-more'><a href='http://cocobear.info/blog/2008/08/15/deal-with-wes/'>阅读全文内容</a></p>]]></description>
		<wfw:commentRss>http://cocobear.info/blog/2008/08/15/deal-with-wes/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>shell脚本解题5</title>
		<link>http://cocobear.info/blog/2008/07/24/06-issues-shell/</link>
		<comments>http://cocobear.info/blog/2008/07/24/06-issues-shell/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 09:37:36 +0000</pubDate>
		<dc:creator>可可熊</dc:creator>
				<category><![CDATA[Shell]]></category>
		<category><![CDATA[编程相关]]></category>
		<category><![CDATA[awk]]></category>

		<guid isPermaLink="false">http://cocobear.info/blog/?p=295</guid>
		<description><![CDATA[问题：
随机输出目录下5个文件：

<strong>解法：
1.</strong>
[bash]
#! /bin/bash
arr=($(ls *.sql.gz))
len=$((${#arr[@]}+1))

for((i=1;i&#60;6;i++))
do
        RANDOM=$(($$+i))[......]<p class='read-more'><a href='http://cocobear.info/blog/2008/07/24/06-issues-shell/'>阅读全文内容</a></p>]]></description>
		<wfw:commentRss>http://cocobear.info/blog/2008/07/24/06-issues-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>shell脚本解题4</title>
		<link>http://cocobear.info/blog/2008/07/18/05-issues-shell/</link>
		<comments>http://cocobear.info/blog/2008/07/18/05-issues-shell/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 08:24:32 +0000</pubDate>
		<dc:creator>可可熊</dc:creator>
				<category><![CDATA[Shell]]></category>
		<category><![CDATA[编程相关]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://cocobear.info/blog/?p=294</guid>
		<description><![CDATA[问题：
用sed把每行的第二个字符到第六个字符替换成星号
原文
123456
1234567
12345

要求结果

1*****
1*****7
1****

<strong>解法：
1.</strong>
[bash]sed '/^../{h;s/^.\(.\{1,5\}\).*/\1/;s/./[......]<p class='read-more'><a href='http://cocobear.info/blog/2008/07/18/05-issues-shell/'>阅读全文内容</a></p>]]></description>
		<wfw:commentRss>http://cocobear.info/blog/2008/07/18/05-issues-shell/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>shell脚本解题3</title>
		<link>http://cocobear.info/blog/2008/07/16/04-issues-shell/</link>
		<comments>http://cocobear.info/blog/2008/07/16/04-issues-shell/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 05:15:42 +0000</pubDate>
		<dc:creator>可可熊</dc:creator>
				<category><![CDATA[Shell]]></category>
		<category><![CDATA[编程相关]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://cocobear.info/blog/?p=291</guid>
		<description><![CDATA[<strong>问题：</strong>
如何将命令的输出信息按行放入到数组里面?

<strong>解法：
1.</strong>
[bash]n=0
while read line;do 
        array[$n]="$line"
        ((n++))
done <]]></description>
		<wfw:commentRss>http://cocobear.info/blog/2008/07/16/04-issues-shell/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>shell脚本解题2</title>
		<link>http://cocobear.info/blog/2008/07/15/03-issues-shell/</link>
		<comments>http://cocobear.info/blog/2008/07/15/03-issues-shell/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 09:12:33 +0000</pubDate>
		<dc:creator>可可熊</dc:creator>
				<category><![CDATA[Shell]]></category>
		<category><![CDATA[编程相关]]></category>

		<guid isPermaLink="false">http://cocobear.info/blog/?p=292</guid>
		<description><![CDATA[<strong>问题：</strong>
如下文本

60.208.0.224
60.208.103.192
131.9.124.72
60.208.20.119
60.208.20.9
2.110.213.40
8.56.32.24
60.53.37.128
60.3.98.1

怎么先按ip的第一位so[......]<p class='read-more'><a href='http://cocobear.info/blog/2008/07/15/03-issues-shell/'>阅读全文内容</a></p>]]></description>
		<wfw:commentRss>http://cocobear.info/blog/2008/07/15/03-issues-shell/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>shell脚本解题1</title>
		<link>http://cocobear.info/blog/2008/07/10/02-issues-shell/</link>
		<comments>http://cocobear.info/blog/2008/07/10/02-issues-shell/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 05:28:24 +0000</pubDate>
		<dc:creator>可可熊</dc:creator>
				<category><![CDATA[Shell]]></category>
		<category><![CDATA[编程相关]]></category>

		<guid isPermaLink="false">http://cocobear.info/blog/?p=289</guid>
		<description><![CDATA[<br />
<b>Fatal error</b>:  Maximum execution time of 30 seconds exceeded in <b>/home/cocobea1/public_html/cocobear.info/blog/wp-content/plugins/wp-utf8-excerpt/wp-utf8-excerpt.php</b> on line <b>182</b><br />

