<?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>Oracle Berkeley DB 中国研发团队的博客 &#187; scripting</title>
	<atom:link href="http://www.bdbchina.com/tag/scripting/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bdbchina.com</link>
	<description>Oracle Berkeley DB 中国研发团队的博客</description>
	<lastBuildDate>Fri, 09 Jul 2010 06:44:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>利用stderr创建空白文本文件</title>
		<link>http://www.bdbchina.com/2009/03/%e5%88%a9%e7%94%a8stderr%e5%88%9b%e5%bb%ba%e7%a9%ba%e7%99%bd%e6%96%87%e6%9c%ac%e6%96%87%e4%bb%b6/</link>
		<comments>http://www.bdbchina.com/2009/03/%e5%88%a9%e7%94%a8stderr%e5%88%9b%e5%bb%ba%e7%a9%ba%e7%99%bd%e6%96%87%e6%9c%ac%e6%96%87%e4%bb%b6/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 10:29:58 +0000</pubDate>
		<dc:creator>赵汝聪</dc:creator>
				<category><![CDATA[程序设计]]></category>
		<category><![CDATA[赵汝聪]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://www.bdbchina.com/?p=135</guid>
		<description><![CDATA[在Windows脚本里面创建空白文本文件真是困难重重。采用 echo &#62;tmp.txt是不行的，因为echo会可耻地输出&#8221;echo on&#8221;。再试试&#8221;echo off&#8221;+&#8221;echo on&#8221;的组合拳？依然毫无效果。猛然惊觉系统还有闲置的一条康庄大道stderr，使用之：
echo 2&#62; tmp.txt
stderr没有任何输出，自然产生一个空白文本文件。整个世界清静了&#8230;
]]></description>
			<content:encoded><![CDATA[<p>在Windows脚本里面创建空白文本文件真是困难重重。采用 echo &gt;tmp.txt是不行的，因为echo会可耻地输出&#8221;echo on&#8221;。再试试&#8221;echo off&#8221;+&#8221;echo on&#8221;的组合拳？依然毫无效果。猛然惊觉系统还有闲置的一条康庄大道stderr，使用之：</p>
<p>echo 2&gt; tmp.txt</p>
<p>stderr没有任何输出，自然产生一个空白文本文件。整个世界清静了&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bdbchina.com/2009/03/%e5%88%a9%e7%94%a8stderr%e5%88%9b%e5%bb%ba%e7%a9%ba%e7%99%bd%e6%96%87%e6%9c%ac%e6%96%87%e4%bb%b6/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>运行Shell脚本的几种方式解析</title>
		<link>http://www.bdbchina.com/2009/02/%e8%bf%90%e8%a1%8cshell%e8%84%9a%e6%9c%ac%e7%9a%84%e5%87%a0%e7%a7%8d%e6%96%b9%e5%bc%8f%e8%a7%a3%e6%9e%90/</link>
		<comments>http://www.bdbchina.com/2009/02/%e8%bf%90%e8%a1%8cshell%e8%84%9a%e6%9c%ac%e7%9a%84%e5%87%a0%e7%a7%8d%e6%96%b9%e5%bc%8f%e8%a7%a3%e6%9e%90/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 09:11:27 +0000</pubDate>
		<dc:creator>Winter</dc:creator>
				<category><![CDATA[Berkeley DB]]></category>
		<category><![CDATA[Winter Zhang]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://www.bdbchina.com/?p=71</guid>
		<description><![CDATA[假设脚本为a.sh,则要运行该脚本,有以下方式
1 给脚本加上执行权限chmod u+x a.sh, 而后就可以直接用全路径来执行脚本了,比如当前文件夹下用./a.sh, 如果脚本所在目录在PATH环境变量之中, 则直接用a.sh即可
2 sh/bash a.sh的路径,这种情况不需要脚本具有执行权限.
以上两种情况中,脚本中$0都是a.sh,都是在shell的子进程中运行的.
3 source a.sh的路径
4 . a.sh的路径
以 上两种情况都是脚本在当前shell的进程中运行,所以$0都是bash/sh, 区别在于, source不是posix shell的内置命令,所以3在sh中实际上是不能运行的,在bash中可以. 而.则无论在bash还是posix shell中都是可以用来载入并执行脚本. 所以, 相对而言, 应该是4 更加具有移植性.
]]></description>
			<content:encoded><![CDATA[<p>假设脚本为a.sh,则要运行该脚本,有以下方式</p>
<p>1 给脚本加上执行权限chmod u+x a.sh, 而后就可以直接用全路径来执行脚本了,比如当前文件夹下用./a.sh, 如果脚本所在目录在PATH环境变量之中, 则直接用a.sh即可</p>
<p>2 sh/bash a.sh的路径,这种情况不需要脚本具有执行权限.</p>
<p>以上两种情况中,脚本中$0都是a.sh,都是在shell的子进程中运行的.</p>
<p>3 source a.sh的路径</p>
<p>4 . a.sh的路径</p>
<p>以 上两种情况都是脚本在当前shell的进程中运行,所以$0都是bash/sh, 区别在于, source不是posix shell的内置命令,所以3在sh中实际上是不能运行的,在bash中可以. 而.则无论在bash还是posix shell中都是可以用来载入并执行脚本. 所以, 相对而言, 应该是4 更加具有移植性.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bdbchina.com/2009/02/%e8%bf%90%e8%a1%8cshell%e8%84%9a%e6%9c%ac%e7%9a%84%e5%87%a0%e7%a7%8d%e6%96%b9%e5%bc%8f%e8%a7%a3%e6%9e%90/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
Դ