<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>“IGI&#039;s Blog” 的评论</title>
	<atom:link href="http://www.igigo.net/comments/feed" rel="self" type="application/rss+xml" />
	<link>http://www.igigo.net</link>
	<description></description>
	<lastBuildDate>Sat, 04 Feb 2012 01:29:40 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
	<item>
		<title>nonoob 关于 Bash引号的那点事 的评论</title>
		<link>http://www.igigo.net/archives/128#comment-1048</link>
		<dc:creator>nonoob</dc:creator>
		<pubDate>Sat, 04 Feb 2012 01:29:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.igigo.net/?p=128#comment-1048</guid>
		<description>您好！在&lt;i&gt;3. 引号嵌套总是混乱的&lt;/i&gt;双引号echo &quot;abc\&#039;abc&quot;时在我的终端中得到的abc\&#039;abc，其他两个例子都一致，想请教一下什么原因 :neutral: bash的版本是4.2，另外我在sh和zsh中也得到了带\的结果。</description>
		<content:encoded><![CDATA[<p>您好！在<i>3. 引号嵌套总是混乱的</i>双引号echo &#8220;abc\&#8217;abc&#8221;时在我的终端中得到的abc\&#8217;abc，其他两个例子都一致，想请教一下什么原因 <img src='http://www.igigo.net/wp-includes/images/smilies/icon_neutral.gif' alt=':neutral:' class='wp-smiley' />  bash的版本是4.2，另外我在sh和zsh中也得到了带\的结果。</p>
]]></content:encoded>
	</item>
	<item>
		<title>skip 关于 Dash与Bash的语法区别 的评论</title>
		<link>http://www.igigo.net/archives/169#comment-949</link>
		<dc:creator>skip</dc:creator>
		<pubDate>Sat, 17 Sep 2011 07:40:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.igigo.net/?p=169#comment-949</guid>
		<description>怪不得！！！</description>
		<content:encoded><![CDATA[<p>怪不得！！！</p>
]]></content:encoded>
	</item>
	<item>
		<title>彭修林 关于 Dash与Bash的语法区别 的评论</title>
		<link>http://www.igigo.net/archives/169#comment-942</link>
		<dc:creator>彭修林</dc:creator>
		<pubDate>Wed, 31 Aug 2011 02:39:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.igigo.net/?p=169#comment-942</guid>
		<description>:smile: 
dash是标准POSIX实现，因而更通用一些
dash更小、更容易学，然而好好组织组织也能写出强大的功能。
&lt;a href=&quot;http://stackoverflow.com/questions/5725296/difference-between-sh-and-bash&quot; rel=&quot;nofollow&quot;&gt;stack over flow上面有介绍&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p> <img src='http://www.igigo.net/wp-includes/images/smilies/icon_smile.gif' alt=':smile:' class='wp-smiley' /><br />
dash是标准POSIX实现，因而更通用一些<br />
dash更小、更容易学，然而好好组织组织也能写出强大的功能。<br />
<a href="http://stackoverflow.com/questions/5725296/difference-between-sh-and-bash" rel="nofollow">stack over flow上面有介绍</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>abbyjwj 关于 EDAC错误 的评论</title>
		<link>http://www.igigo.net/archives/61#comment-939</link>
		<dc:creator>abbyjwj</dc:creator>
		<pubDate>Tue, 16 Aug 2011 16:22:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.igigo.net/?p=61#comment-939</guid>
		<description>&lt;a href=&quot;http://www.ruletagratis.ws/&quot; rel=&quot;nofollow&quot;&gt;ruleta&lt;/a&gt;
ruleta</description>
		<content:encoded><![CDATA[<p><a href="http://www.ruletagratis.ws/" rel="nofollow">ruleta</a><br />
ruleta</p>
]]></content:encoded>
	</item>
	<item>
		<title>bmrs 关于 Bash空格的那点事 的评论</title>
		<link>http://www.igigo.net/archives/152#comment-937</link>
		<dc:creator>bmrs</dc:creator>
		<pubDate>Mon, 15 Aug 2011 05:01:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.igigo.net/?p=152#comment-937</guid>
		<description>大赞！ 事无巨细，讲的很明白啊</description>
		<content:encoded><![CDATA[<p>大赞！ 事无巨细，讲的很明白啊</p>
]]></content:encoded>
	</item>
	<item>
		<title>abbyzmq 关于 EDAC错误 的评论</title>
		<link>http://www.igigo.net/archives/61#comment-936</link>
		<dc:creator>abbyzmq</dc:creator>
		<pubDate>Thu, 11 Aug 2011 19:02:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.igigo.net/?p=61#comment-936</guid>
		<description>&lt;a href=&quot;http://www.opentechcenter.com/&quot; rel=&quot;nofollow&quot;&gt;casino bonus utan ins</description>
		<content:encoded><![CDATA[<p><a href="http://www.opentechcenter.com/" rel="nofollow">casino bonus utan ins</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>igi 关于 有趣的命令 的评论</title>
		<link>http://www.igigo.net/cmd#comment-935</link>
		<dc:creator>igi</dc:creator>
		<pubDate>Thu, 11 Aug 2011 07:17:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.igigo.net#comment-935</guid>
		<description>打印匹配字符串之间的所有行，如果包含匹配行，awk和sed做起来都很简单
[shell]
igi@gentoo /tmp $ seq 10 &#124; sed -n &#039;/3/,/6/p&#039;
3
4
5
6
igi@gentoo /tmp $ seq 10 &#124; awk &#039;/3/,/6/&#039;
3
4
5
6
igi@gentoo /tmp $ 
[/shell]
但如果是不要匹配行呢? 其实也不难
[shell]
igi@gentoo /tmp $ seq 10 &#124; sed -n &#039;/3/{:f;n;/6/q;p;bf}&#039;
4
5
igi@gentoo /tmp $ seq 10 &#124; awk &#039;/3/{f=1;next};/6/{exit};f&#039;
4
5
igi@gentoo /tmp $ 
[/shell]
当然以上只考虑了只存在唯一的匹配字符串的情况，如果不是唯一的，那么就要分情况来说了</description>
		<content:encoded><![CDATA[<p>打印匹配字符串之间的所有行，如果包含匹配行，awk和sed做起来都很简单</p>
<pre class="brush: bash; title: ;">
igi@gentoo /tmp $ seq 10 | sed -n '/3/,/6/p'
3
4
5
6
igi@gentoo /tmp $ seq 10 | awk '/3/,/6/'
3
4
5
6
igi@gentoo /tmp $
</pre>
<p>但如果是不要匹配行呢? 其实也不难</p>
<pre class="brush: bash; title: ;">
igi@gentoo /tmp $ seq 10 | sed -n '/3/{:f;n;/6/q;p;bf}'
4
5
igi@gentoo /tmp $ seq 10 | awk '/3/{f=1;next};/6/{exit};f'
4
5
igi@gentoo /tmp $
</pre>
<p>当然以上只考虑了只存在唯一的匹配字符串的情况，如果不是唯一的，那么就要分情况来说了</p>
]]></content:encoded>
	</item>
	<item>
		<title>Ubuntu- 執行shell script 為什麼常發生 unexpected operator &#124; 易春木 关于 Dash与Bash的语法区别 的评论</title>
		<link>http://www.igigo.net/archives/169#comment-934</link>
		<dc:creator>Ubuntu- 執行shell script 為什麼常發生 unexpected operator &#124; 易春木</dc:creator>
		<pubDate>Mon, 01 Aug 2011 02:39:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.igigo.net/?p=169#comment-934</guid>
		<description>[...] - dash 與 bash 寫法的差異: http://www.igigo.net/archives/169 [...]</description>
		<content:encoded><![CDATA[<p>[...] &#8211; dash 與 bash 寫法的差異: <a href="http://www.igigo.net/archives/169" rel="nofollow">http://www.igigo.net/archives/169</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>abel 关于 Shell提问板 的评论</title>
		<link>http://www.igigo.net/shell%e6%8f%90%e9%97%ae%e6%9d%bf#comment-930</link>
		<dc:creator>abel</dc:creator>
		<pubDate>Thu, 16 Jun 2011 07:35:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.igigo.net/?page_id=62#comment-930</guid>
		<description>#!/usr/bin/expect
spawn echo &quot;1.samba-server 192.168.0.2&quot;
spawn echo &quot;2.sql-server 192.168.0.3&quot;
spawn echo -n &quot;Choose whitch server you want connect :&quot;
read var   #expect不识别这个read var 请问该怎么写？
case $var in
1)
        set ip=192.168.0.2
        set password=123456 ;;
2)
        set ip=192.168.0.3
        set password=123123 ;;
*)
        echo &quot;Only can choose all above !!&quot;
esac
spawn ssh root@ip
expect &quot;*password:*&quot;
send -- &quot;$password\r&quot;</description>
		<content:encoded><![CDATA[<p>#!/usr/bin/expect<br />
spawn echo &#8220;1.samba-server 192.168.0.2&#8243;<br />
spawn echo &#8220;2.sql-server 192.168.0.3&#8243;<br />
spawn echo -n &#8220;Choose whitch server you want connect :&#8221;<br />
read var   #expect不识别这个read var 请问该怎么写？<br />
case $var in<br />
1)<br />
        set ip=192.168.0.2<br />
        set password=123456 ;;<br />
2)<br />
        set ip=192.168.0.3<br />
        set password=123123 ;;<br />
*)<br />
        echo &#8220;Only can choose all above !!&#8221;<br />
esac<br />
spawn ssh root@ip<br />
expect &#8220;*password:*&#8221;<br />
send &#8212; &#8220;$password\r&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>igi 关于 有趣的命令 的评论</title>
		<link>http://www.igigo.net/cmd#comment-929</link>
		<dc:creator>igi</dc:creator>
		<pubDate>Wed, 15 Jun 2011 05:47:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.igigo.net#comment-929</guid>
		<description>获取当前的shell名称
常见的方法是
[shell]
igi@gentoo /tmp $ echo $0
/bin/bash
igi@gentoo /tmp $ echo $SHELL
/bin/bash
igi@gentoo /tmp $ dash
$ echo $0
dash
$ 
[/shell]
不过这个$0在脚本中可就不是当前shell的名字，而是脚本的名字
[shell]
igi@gentoo /tmp $ cat test.sh
#!/bin/dash
echo $0
igi@gentoo /tmp $ ./test.sh
./test.sh
igi@gentoo /tmp $ bash test.sh
test.sh
[/shell]

下面介绍的方法可以通吃不同的情况
[shell]
igi@gentoo /tmp $ ps -p $$ -o command= &#124; awk &#039;{print $1}&#039;
/bin/bash
igi@gentoo /tmp $ cat test.sh
#!/bin/dash
ps -p $$ -o command= &#124; awk &#039;{print $1}&#039;
igi@gentoo /tmp $ ./test.sh
/bin/dash
igi@gentoo /tmp $ bash test.sh
bash
igi@gentoo /tmp $ dash test.sh
dash
igi@gentoo /tmp $ . test.sh
/bin/bash
[/shell]</description>
		<content:encoded><![CDATA[<p>获取当前的shell名称<br />
常见的方法是</p>
<pre class="brush: bash; title: ;">
igi@gentoo /tmp $ echo $0
/bin/bash
igi@gentoo /tmp $ echo $SHELL
/bin/bash
igi@gentoo /tmp $ dash
$ echo $0
dash
$
</pre>
<p>不过这个$0在脚本中可就不是当前shell的名字，而是脚本的名字</p>
<pre class="brush: bash; title: ;">
igi@gentoo /tmp $ cat test.sh
#!/bin/dash
echo $0
igi@gentoo /tmp $ ./test.sh
./test.sh
igi@gentoo /tmp $ bash test.sh
test.sh
</pre>
<p>下面介绍的方法可以通吃不同的情况</p>
<pre class="brush: bash; title: ;">
igi@gentoo /tmp $ ps -p $$ -o command= | awk '{print $1}'
/bin/bash
igi@gentoo /tmp $ cat test.sh
#!/bin/dash
ps -p $$ -o command= | awk '{print $1}'
igi@gentoo /tmp $ ./test.sh
/bin/dash
igi@gentoo /tmp $ bash test.sh
bash
igi@gentoo /tmp $ dash test.sh
dash
igi@gentoo /tmp $ . test.sh
/bin/bash
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>

