<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/css" href="./clientscript/vbulletin_css/rsstyle.css"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>LinuxSir.Org - Linux shell进阶应用与shell编程</title>
		<link>http://www.linuxsir.org/bbs</link>
		<description>基础的基础，重中之重。</description>
		<language>zh</language>
		<lastBuildDate>Fri, 03 Sep 2010 04:20:36 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://www.linuxsir.org/bbs/images/misc/rss.jpg</url>
			<title>LinuxSir.Org - Linux shell进阶应用与shell编程</title>
			<link>http://www.linuxsir.org/bbs</link>
		</image>
		<item>
			<title>如何处理从文中搜索并把缓存内容存入 read的变量中</title>
			<link>http://www.linuxsir.org/bbs/showthread.php?t=371940&amp;goto=newpost</link>
			<pubDate>Wed, 01 Sep 2010 08:43:50 GMT</pubDate>
			<description><![CDATA[有几行代码如下：
grep  "$name"   file  |
while   read  name
do
    echo "Do you want to remove $name?(y/n)"
    read choice
done

这时如果在file文件中搜索到多个匹配值，然后这些匹配是不是先保存到一个缓存区中，在每次出现read时就把其中的一行缓存保存到read后的变量中？这样的话，如何处理才能使得在while判断条件中读取匹配的缓存，而在下面输入选择y/n时可以正常输入后保存到下一行read后的choice变量中？]]></description>
			<content:encoded><![CDATA[<div>有几行代码如下：<br />
grep  &quot;$name&quot;   file  |<br />
while   read  name<br />
do<br />
    echo &quot;Do you want to remove $name?(y/n)&quot;<br />
    read choice<br />
done<br />
<br />
这时如果在file文件中搜索到多个匹配值，然后这些匹配是不是先保存到一个缓存区中，在每次出现read时就把其中的一行缓存保存到read后的变量中？这样的话，如何处理才能使得在while判断条件中读取匹配的缓存，而在下面输入选择y/n时可以正常输入后保存到下一行read后的choice变量中？</div>

]]></content:encoded>
			<category domain="http://www.linuxsir.org/bbs/forumdisplay.php?f=60">Linux shell进阶应用与shell编程</category>
			<dc:creator>flyer103</dc:creator>
			<guid isPermaLink="true">http://www.linuxsir.org/bbs/showthread.php?t=371940</guid>
		</item>
		<item>
			<title>有关set -e和子shell的问题</title>
			<link>http://www.linuxsir.org/bbs/showthread.php?t=371939&amp;goto=newpost</link>
			<pubDate>Wed, 01 Sep 2010 08:13:15 GMT</pubDate>
			<description><![CDATA[echo "ada" && (set -e; echo "yes"; cat nothing; echo "no")
 echo "ret: $?"

 echo "ada" && (set -e; echo "yes"; cat nothing; echo "no") && echo "123123"
 echo "ret: $?"

子shell的执行结果不一致，第一例不会打印 no， 第二例会打印no，
返回值也不同。

这是为什么呢？]]></description>
			<content:encoded><![CDATA[<div>echo &quot;ada&quot; &amp;&amp; (set -e; echo &quot;yes&quot;; cat nothing; echo &quot;no&quot;)<br />
 echo &quot;ret: $?&quot;<br />
<br />
 echo &quot;ada&quot; &amp;&amp; (set -e; echo &quot;yes&quot;; cat nothing; echo &quot;no&quot;) &amp;&amp; echo &quot;123123&quot;<br />
 echo &quot;ret: $?&quot;<br />
<br />
子shell的执行结果不一致，第一例不会打印 no， 第二例会打印no，<br />
返回值也不同。<br />
<br />
这是为什么呢？</div>

]]></content:encoded>
			<category domain="http://www.linuxsir.org/bbs/forumdisplay.php?f=60">Linux shell进阶应用与shell编程</category>
			<dc:creator>fiag</dc:creator>
			<guid isPermaLink="true">http://www.linuxsir.org/bbs/showthread.php?t=371939</guid>
		</item>
		<item>
			<title>==显示某个用户登陆过的所有机器的Log操作日志==</title>
			<link>http://www.linuxsir.org/bbs/showthread.php?t=371937&amp;goto=newpost</link>
			<pubDate>Wed, 01 Sep 2010 07:19:03 GMT</pubDate>
			<description><![CDATA[各位大虾，我想编写一个脚本，显示某个用户登陆过的所有机器的Log操作日志。
cat /root/bin/all_iplist      //这个文件定义了所有机器的IP地址
10.1.5.1
10.1.5.2
10.1.5.3
10.1.5.4
10.1.5.5

for x in `cat /root/etc/all_iplist`;do echo ========$x========;ssh $x "last | grep abc";done
//用这个命令可以显示abc用户在哪个机器登陆过

tail /var/log/abc213        //假设用户操作的命令都写在这个文件里面，这个文件显示格式是这样的。
[ 20100901 16:02:33 root /dev/pts/8] ls
[ 20100901 16:02:36 root /dev/pts/8] cd /home/test/
[ 20100901 16:02:37 root /dev/pts/8] ls
[ 20100901 16:02:47 root /dev/pts/8] cd abcTest/
[ 20100901 16:02:47 root /dev/pts/8] ls
[ 20100901 16:02:49 root /dev/pts/8] cd bin/
[ 20100901 16:02:50 root /dev/pts/8] ls

这是所有的文件材料，请各位大虾帮我编写这么一个脚本吧，我先谢谢各位大虾了。]]></description>
			<content:encoded><![CDATA[<div>各位大虾，我想编写一个脚本，显示某个用户登陆过的所有机器的Log操作日志。<br />
cat /root/bin/all_iplist      //这个文件定义了所有机器的IP地址<br />
10.1.5.1<br />
10.1.5.2<br />
10.1.5.3<br />
10.1.5.4<br />
10.1.5.5<br />
<br />
for x in `cat /root/etc/all_iplist`;do echo ========$x========;ssh $x &quot;last | grep abc&quot;;done<br />
//用这个命令可以显示abc用户在哪个机器登陆过<br />
<br />
tail /var/log/abc213        //假设用户操作的命令都写在这个文件里面，这个文件显示格式是这样的。<br />
[ 20100901 16:02:33 root /dev/pts/8] ls<br />
[ 20100901 16:02:36 root /dev/pts/8] cd /home/test/<br />
[ 20100901 16:02:37 root /dev/pts/8] ls<br />
[ 20100901 16:02:47 root /dev/pts/8] cd abcTest/<br />
[ 20100901 16:02:47 root /dev/pts/8] ls<br />
[ 20100901 16:02:49 root /dev/pts/8] cd bin/<br />
[ 20100901 16:02:50 root /dev/pts/8] ls<br />
<br />
这是所有的文件材料，请各位大虾帮我编写这么一个脚本吧，我先谢谢各位大虾了。</div>

]]></content:encoded>
			<category domain="http://www.linuxsir.org/bbs/forumdisplay.php?f=60">Linux shell进阶应用与shell编程</category>
			<dc:creator>奋斗的毛毛虫</dc:creator>
			<guid isPermaLink="true">http://www.linuxsir.org/bbs/showthread.php?t=371937</guid>
		</item>
		<item>
			<title>帮忙解释一下下面的递归</title>
			<link>http://www.linuxsir.org/bbs/showthread.php?t=371773&amp;goto=newpost</link>
			<pubDate>Tue, 24 Aug 2010 09:38:03 GMT</pubDate>
			<description><![CDATA[XE_DISPLAY=":2.0"
VB="/root/moblin-beta+hildon"
MP="/proc /dev /dev/pts /sys"

function list_umount()
{
    if [ $# = 0 ];then
     	return;
    fi

    list="";
    flag=1;
    for e in $@
    do
        if [ $flag != 1 ];then
	       list+="$e ";
	    fi

	    flag=2;
    done

    list_umount $list;

    echo "umount $VB$1"
    umount $VB$1;
}
能帮忙给解释一下么？详细点……]]></description>
			<content:encoded><![CDATA[<div>XE_DISPLAY=&quot;:2.0&quot;<br />
VB=&quot;/root/moblin-beta+hildon&quot;<br />
MP=&quot;/proc /dev /dev/pts /sys&quot;<br />
<br />
function list_umount()<br />
{<br />
    if [ $# = 0 ];then<br />
     	return;<br />
    fi<br />
<br />
    list=&quot;&quot;;<br />
    flag=1;<br />
    for e in $@<br />
    do<br />
        if [ $flag != 1 ];then<br />
	       list+=&quot;$e &quot;;<br />
	    fi<br />
<br />
	    flag=2;<br />
    done<br />
<br />
    list_umount $list;<br />
<br />
    echo &quot;umount $VB$1&quot;<br />
    umount $VB$1;<br />
}<br />
能帮忙给解释一下么？详细点……</div>

]]></content:encoded>
			<category domain="http://www.linuxsir.org/bbs/forumdisplay.php?f=60">Linux shell进阶应用与shell编程</category>
			<dc:creator>dwl301</dc:creator>
			<guid isPermaLink="true">http://www.linuxsir.org/bbs/showthread.php?t=371773</guid>
		</item>
		<item>
			<title>请教下为什么这个shell无法正常执行</title>
			<link>http://www.linuxsir.org/bbs/showthread.php?t=371753&amp;goto=newpost</link>
			<pubDate>Tue, 24 Aug 2010 09:10:13 GMT</pubDate>
			<description><![CDATA[我有两个文件,其中一个叫 Head,里面存放的内容格式为:

571    1234567
572    1234545
....

中间的分隔符为一个tab;

另一个文件,名字叫body,存放的内容格式为: 
12345678910
12345451235
....

前七位与head中的某一个相对应.

我现在要写一个脚本,要求是 输入"571"这样的参数,输出body中"571"所对应的"1234567"等开头的所有行.我写的代码如下:


代码:
---------
   #!/bin/bash
   #LIST=`grep $1 head|awk '{print $2}'`
   for i in `grep $1 head|awk '{print $2}'`;
   #for i in $LIST;
   do
   grep $i body
   #echo $i
   #echo $LIST
   done
---------
注释的地方是我的一些调试代码. 现在这个shell的执行情况是倘若echo $i的话,结果正常;如果grep $i body 的话,则没有输出. 这中间什么地方写错了吗?]]></description>
			<content:encoded><![CDATA[<div>我有两个文件,其中一个叫 Head,里面存放的内容格式为:<br />
<br />
571    1234567<br />
572    1234545<br />
....<br />
<br />
中间的分隔符为一个tab;<br />
<br />
另一个文件,名字叫body,存放的内容格式为: <br />
12345678910<br />
12345451235<br />
....<br />
<br />
前七位与head中的某一个相对应.<br />
<br />
我现在要写一个脚本,要求是 输入&quot;571&quot;这样的参数,输出body中&quot;571&quot;所对应的&quot;1234567&quot;等开头的所有行.我写的代码如下:<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">代码:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">&nbsp;  #!/bin/bash<br />
&nbsp;  #LIST=`grep $1 head|awk '{print $2}'`<br />
&nbsp;  for i in `grep $1 head|awk '{print $2}'`;<br />
&nbsp;  #for i in $LIST;<br />
&nbsp;  do<br />
&nbsp;  grep $i body<br />
&nbsp;  #echo $i<br />
&nbsp;  #echo $LIST<br />
&nbsp;  done</code><hr />
</div>注释的地方是我的一些调试代码. 现在这个shell的执行情况是倘若echo $i的话,结果正常;如果grep $i body 的话,则没有输出. 这中间什么地方写错了吗?</div>

]]></content:encoded>
			<category domain="http://www.linuxsir.org/bbs/forumdisplay.php?f=60">Linux shell进阶应用与shell编程</category>
			<dc:creator>ywwow</dc:creator>
			<guid isPermaLink="true">http://www.linuxsir.org/bbs/showthread.php?t=371753</guid>
		</item>
		<item>
			<title>$$f 是啥意思</title>
			<link>http://www.linuxsir.org/bbs/showthread.php?t=371749&amp;goto=newpost</link>
			<pubDate>Tue, 24 Aug 2010 06:22:29 GMT</pubDate>
			<description>for f in *.4.5.3 ; do
  ln -sf $$f $${f%%.3};

$$f 是啥意思啊？</description>
			<content:encoded><![CDATA[<div>for f in *.4.5.3 ; do<br />
  ln -sf $$f $${f%%.3};<br />
<br />
$$f 是啥意思啊？</div>

]]></content:encoded>
			<category domain="http://www.linuxsir.org/bbs/forumdisplay.php?f=60">Linux shell进阶应用与shell编程</category>
			<dc:creator>Heefan</dc:creator>
			<guid isPermaLink="true">http://www.linuxsir.org/bbs/showthread.php?t=371749</guid>
		</item>
		<item>
			<title>幫忙看看這個unbound variable</title>
			<link>http://www.linuxsir.org/bbs/showthread.php?t=371672&amp;goto=newpost</link>
			<pubDate>Fri, 20 Aug 2010 15:03:28 GMT</pubDate>
			<description><![CDATA[例子來自ABS的Example 4-7


代码:
---------
until [ -z "${1}" ]
do
echo -n "${1}"
shift
done
---------
運行時會抱錯，在最後一次循環的時候，這時候${1}的長度為0，應該是離開循環，但是確保了unbound variable
$? 為 1]]></description>
			<content:encoded><![CDATA[<div>例子來自ABS的Example 4-7<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">代码:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">until [ -z &quot;${1}&quot; ]<br />
do<br />
echo -n &quot;${1}&quot;<br />
shift<br />
done</code><hr />
</div>運行時會抱錯，在最後一次循環的時候，這時候${1}的長度為0，應該是離開循環，但是確保了unbound variable<br />
$? 為 1</div>

]]></content:encoded>
			<category domain="http://www.linuxsir.org/bbs/forumdisplay.php?f=60">Linux shell进阶应用与shell编程</category>
			<dc:creator>ztkx</dc:creator>
			<guid isPermaLink="true">http://www.linuxsir.org/bbs/showthread.php?t=371672</guid>
		</item>
		<item>
			<title>请问Shell里如何调用系统默认程序打开文件</title>
			<link>http://www.linuxsir.org/bbs/showthread.php?t=371605&amp;goto=newpost</link>
			<pubDate>Wed, 18 Aug 2010 10:00:37 GMT</pubDate>
			<description>比如，x-www-browser file，会用默认浏览器打开file
我想知道其它类型的文件，如何用默认程序打开？
比如说图像，音乐文件。</description>
			<content:encoded><![CDATA[<div>比如，x-www-browser file，会用默认浏览器打开file<br />
我想知道其它类型的文件，如何用默认程序打开？<br />
比如说图像，音乐文件。</div>

]]></content:encoded>
			<category domain="http://www.linuxsir.org/bbs/forumdisplay.php?f=60">Linux shell进阶应用与shell编程</category>
			<dc:creator>turtlerock</dc:creator>
			<guid isPermaLink="true">http://www.linuxsir.org/bbs/showthread.php?t=371605</guid>
		</item>
		<item>
			<title>awk 中 \n 的意思</title>
			<link>http://www.linuxsir.org/bbs/showthread.php?t=371579&amp;goto=newpost</link>
			<pubDate>Tue, 17 Aug 2010 08:35:31 GMT</pubDate>
			<description><![CDATA[[root@shpdl380prx2 nm308]# cat data2
Riley Mullen
123 Main Street
Chicago, IT 60601
(312)555-1234

Frank Williams
456 Oak Street
Indianapolis, IN 46201
(317)555-9876

Haley Snell
4231 Elm Street
Detroit, MI 48201
(313)555-4938
[root@shpdl380prx2 nm308]# awk 'BEGIN{FS="\n";RS=""} {printf "%-16s %s\n", $1, $4}' data2

这里为什么要写成 FS="\n" RS=""

不知道有哪位高人知道]]></description>
			<content:encoded><![CDATA[<div>[root@shpdl380prx2 nm308]# cat data2<br />
Riley Mullen<br />
123 Main Street<br />
Chicago, IT 60601<br />
(312)555-1234<br />
<br />
Frank Williams<br />
456 Oak Street<br />
Indianapolis, IN 46201<br />
(317)555-9876<br />
<br />
Haley Snell<br />
4231 Elm Street<br />
Detroit, MI 48201<br />
(313)555-4938<br />
[root@shpdl380prx2 nm308]# awk 'BEGIN{FS=&quot;\n&quot;;RS=&quot;&quot;} {printf &quot;%-16s %s\n&quot;, $1, $4}' data2<br />
<br />
这里为什么要写成 FS=&quot;\n&quot; RS=&quot;&quot;<br />
<br />
不知道有哪位高人知道</div>

]]></content:encoded>
			<category domain="http://www.linuxsir.org/bbs/forumdisplay.php?f=60">Linux shell进阶应用与shell编程</category>
			<dc:creator>81358458</dc:creator>
			<guid isPermaLink="true">http://www.linuxsir.org/bbs/showthread.php?t=371579</guid>
		</item>
		<item>
			<title>关于source命令的man文档和Tcl script的疑问</title>
			<link>http://www.linuxsir.org/bbs/showthread.php?t=371572&amp;goto=newpost</link>
			<pubDate>Tue, 17 Aug 2010 03:27:28 GMT</pubDate>
			<description>source命令的man文档里的描述有些看不懂啊。
man里说：source - Evaluate a file or resource as a Tcl script.
man解释了一堆source命令的返回值和文档EOF标志的问题。但是我觉得没有说清楚啊。./XXX方式执行命令与source XXX方式执行一个命令的不同之处，搜了下论坛里的帖子：source主要是把当前的shell环境包含到执行的脚本中。而./XXX是开了一个sub shell 环境。那source还有其它作用吗？
另外Tcl script是什么意思？看了wikipedia上的解释，觉得一种脚本语言，但是和shell脚本之间有什么关系吗？</description>
			<content:encoded><![CDATA[<div>source命令的man文档里的描述有些看不懂啊。<br />
man里说：source - Evaluate a file or resource as a Tcl script.<br />
man解释了一堆source命令的返回值和文档EOF标志的问题。但是我觉得没有说清楚啊。./XXX方式执行命令与source XXX方式执行一个命令的不同之处，搜了下论坛里的帖子：source主要是把当前的shell环境包含到执行的脚本中。而./XXX是开了一个sub shell 环境。那source还有其它作用吗？<br />
另外Tcl script是什么意思？看了wikipedia上的解释，觉得一种脚本语言，但是和shell脚本之间有什么关系吗？</div>

]]></content:encoded>
			<category domain="http://www.linuxsir.org/bbs/forumdisplay.php?f=60">Linux shell进阶应用与shell编程</category>
			<dc:creator>ashi</dc:creator>
			<guid isPermaLink="true">http://www.linuxsir.org/bbs/showthread.php?t=371572</guid>
		</item>
		<item>
			<title>书上看到的例子</title>
			<link>http://www.linuxsir.org/bbs/showthread.php?t=371569&amp;goto=newpost</link>
			<pubDate>Tue, 17 Aug 2010 02:56:59 GMT</pubDate>
			<description><![CDATA[[root@shpdl380prx2 nm308]# cat data5
130 120 135
160 113 140
145 170 215
[root@shpdl380prx2 nm308]# awk '{ total = 0;i=1;while(i<4) {total +=$i; i++} avg =total /3;print "Average:",avg }' data5
Average: 128.333
Average: 137.667
Average: 176.667

大多数都能看懂，但不理解为什么最后把除余3后的值都累加起来。
130/3=43.333 120/3=40 135/3=45 Average: 128.333=43.333+40+45]]></description>
			<content:encoded><![CDATA[<div>[root@shpdl380prx2 nm308]# cat data5<br />
130 120 135<br />
160 113 140<br />
145 170 215<br />
[root@shpdl380prx2 nm308]# awk '{ total = 0;i=1;while(i&lt;4) {total +=$i; i++} avg =total /3;print &quot;Average:&quot;,avg }' data5<br />
Average: 128.333<br />
Average: 137.667<br />
Average: 176.667<br />
<br />
大多数都能看懂，但不理解为什么最后把除余3后的值都累加起来。<br />
130/3=43.333 120/3=40 135/3=45 Average: 128.333=43.333+40+45</div>

]]></content:encoded>
			<category domain="http://www.linuxsir.org/bbs/forumdisplay.php?f=60">Linux shell进阶应用与shell编程</category>
			<dc:creator>81358458</dc:creator>
			<guid isPermaLink="true">http://www.linuxsir.org/bbs/showthread.php?t=371569</guid>
		</item>
		<item>
			<title>shell中单引号处理的问题</title>
			<link>http://www.linuxsir.org/bbs/showthread.php?t=371534&amp;goto=newpost</link>
			<pubDate>Sun, 15 Aug 2010 15:09:52 GMT</pubDate>
			<description><![CDATA[请教一下，我现在是又一个脚本，从一个文件中逐行读入字符串，然后扔给php的urldecode来处理，
大体上如下

代码:
---------
php -r "echo urldecode('${line}'.\"\n\");" >> "${TMP2}"
---------
但是现在遇到一个问题就是，如果读出的这行字符串有单引号的话，那么php就会出错，请教一下该如何来处理这个问题。]]></description>
			<content:encoded><![CDATA[<div>请教一下，我现在是又一个脚本，从一个文件中逐行读入字符串，然后扔给php的urldecode来处理，<br />
大体上如下<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">代码:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">php -r &quot;echo urldecode('${line}'.\&quot;\n\&quot;);&quot; &gt;&gt; &quot;${TMP2}&quot;</code><hr />
</div>但是现在遇到一个问题就是，如果读出的这行字符串有单引号的话，那么php就会出错，请教一下该如何来处理这个问题。</div>

]]></content:encoded>
			<category domain="http://www.linuxsir.org/bbs/forumdisplay.php?f=60">Linux shell进阶应用与shell编程</category>
			<dc:creator>scottding</dc:creator>
			<guid isPermaLink="true">http://www.linuxsir.org/bbs/showthread.php?t=371534</guid>
		</item>
		<item>
			<title>如何判断命令输出内容长度大于0并保存到文件</title>
			<link>http://www.linuxsir.org/bbs/showthread.php?t=371529&amp;goto=newpost</link>
			<pubDate>Sun, 15 Aug 2010 11:15:57 GMT</pubDate>
			<description><![CDATA[请问，如何判断一个输出命令的长度是否大于0（是否为空），如果不为空就保存到文件，要求在一句命令行内完成。
比如
ls |grep abcd |判断长度，如果大于0 >temp.dat]]></description>
			<content:encoded><![CDATA[<div>请问，如何判断一个输出命令的长度是否大于0（是否为空），如果不为空就保存到文件，要求在一句命令行内完成。<br />
比如<br />
ls |grep abcd |判断长度，如果大于0 &gt;temp.dat</div>

]]></content:encoded>
			<category domain="http://www.linuxsir.org/bbs/forumdisplay.php?f=60">Linux shell进阶应用与shell编程</category>
			<dc:creator>turtlerock</dc:creator>
			<guid isPermaLink="true">http://www.linuxsir.org/bbs/showthread.php?t=371529</guid>
		</item>
		<item>
			<title>怎么批量从文件内取得文件内容并给文件改名</title>
			<link>http://www.linuxsir.org/bbs/showthread.php?t=371507&amp;goto=newpost</link>
			<pubDate>Sat, 14 Aug 2010 08:45:18 GMT</pubDate>
			<description><![CDATA[我有一些html文件，我需要将它个的文件名改成它们内容中<title>的标题名，并批量的改。

我现在有一些思路，使用find ./ -type f -name "*.html" 找出所有的html文件，然后使用sed取得title后面的内容，然后再改名，还请大家指点一下，如果使用sed取得我需要的内容，并改名


<title>标题-xxxxxxxxxxx</title>
我只需要取得标题，不需要后面的-xxxx内容，然后将这个文件的文件名改为标题.html]]></description>
			<content:encoded><![CDATA[<div>我有一些html文件，我需要将它个的文件名改成它们内容中&lt;title&gt;的标题名，并批量的改。<br />
<br />
我现在有一些思路，使用find ./ -type f -name &quot;*.html&quot; 找出所有的html文件，然后使用sed取得title后面的内容，然后再改名，还请大家指点一下，如果使用sed取得我需要的内容，并改名<br />
<br />
<br />
&lt;title&gt;标题-xxxxxxxxxxx&lt;/title&gt;<br />
我只需要取得标题，不需要后面的-xxxx内容，然后将这个文件的文件名改为标题.html</div>

]]></content:encoded>
			<category domain="http://www.linuxsir.org/bbs/forumdisplay.php?f=60">Linux shell进阶应用与shell编程</category>
			<dc:creator>echo</dc:creator>
			<guid isPermaLink="true">http://www.linuxsir.org/bbs/showthread.php?t=371507</guid>
		</item>
		<item>
			<title>如何使用sed删除文件内的多个行？已解决</title>
			<link>http://www.linuxsir.org/bbs/showthread.php?t=371505&amp;goto=newpost</link>
			<pubDate>Sat, 14 Aug 2010 07:58:33 GMT</pubDate>
			<description>如果要删除一个文件内的多个行怎么办？

例如要删除一个文件内第5到300行要怎么做？</description>
			<content:encoded><![CDATA[<div>如果要删除一个文件内的多个行怎么办？<br />
<br />
例如要删除一个文件内第5到300行要怎么做？</div>

]]></content:encoded>
			<category domain="http://www.linuxsir.org/bbs/forumdisplay.php?f=60">Linux shell进阶应用与shell编程</category>
			<dc:creator>echo</dc:creator>
			<guid isPermaLink="true">http://www.linuxsir.org/bbs/showthread.php?t=371505</guid>
		</item>
	</channel>
</rss>
