Updated user guide.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37849 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -16,13 +16,13 @@
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="Content-Style-Type" content="text/css" />
|
||||
<meta name="robots" content="all" />
|
||||
<title>Bash 和脚本撰写</title>
|
||||
<title>Bash 和脚本</title>
|
||||
<link rel="stylesheet" type="text/css" href="../Haiku-doc.css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="banner">
|
||||
<div><span>User guide</span></div>
|
||||
<div><span>用户指南</span></div>
|
||||
</div>
|
||||
|
||||
<div class="nav">
|
||||
@@ -41,33 +41,32 @@
|
||||
<li><a href="../en/bash-scripting.html"><img src="../images/flags/gb.png" alt="" />English</a></li>
|
||||
</ul>
|
||||
<span>
|
||||
« <a href="preferences.html">Preferences</a>
|
||||
:: <a href="contents.html" class="uplink">Contents</a>
|
||||
<!-- :: <a href="filesystem-layout.html">Filesystem layout</a> » -->
|
||||
« <a href="preferences.html">首选项</a>
|
||||
:: <a href="contents.html" class="uplink">内容</a>
|
||||
<!-- :: <a href="filesystem-layout.html">文件系统布局</a> » -->
|
||||
</span></div>
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
<div>
|
||||
<div class="box-info">The translation of this page isn't yet complete. Until it is, unfinished parts use the English original.</div>
|
||||
|
||||
<h1>Bash 和脚本撰写</h1>
|
||||
<h1>Bash 和脚本</h1>
|
||||
|
||||
<p>“撰写脚本”就是把命令组织成可以自动执行的程序,然后把它保存为文本文件,而该文件就称为“脚本”。每次执行脚本时,这些命令则依次执行,和您在 <a href="applications/terminal.html">Terminal</a> 中输入命令的顺序相同。<br />
|
||||
<p>“撰写脚本”就是把命令组织成可以自动执行的程序,然后把它保存为文本文件,而该文件就称为“脚本”。每次执行脚本时,这些命令则依次执行,和您在<a href="applications/terminal.html">终端</a>中输入命令的顺序相同。<br />
|
||||
脚本既可以用于执行一些简单的命令,也可以通过构建成熟的代码来解决复杂的任务。</p>
|
||||
|
||||
<h2>
|
||||
<a href="#"><img src="../images/up.png" style="border:none;float:right" alt="index" /></a>
|
||||
<a id="bash" name="bash">Bash</a></h2>
|
||||
<p>由于脚本非常依赖于它们的解释器Shell,所以您必须非常地了解Haiku所使用的BASH。Bash的使用非常广泛,所以网上的资源也非常多。其中 Johan Jansson 的 <a href="http://www.beforever.com/bashtut.htm" class="printurl">Introduction to bash - a tutorial for bash under BeOS</a>就是一个非常好的文档。</p>
|
||||
<p>由于脚本非常依赖于它们的解释器Shell,所以您必须非常地了解Haiku所使用的BASH。Bash的使用非常广泛,所以网上的资源也非常多。其中 Johan Jansson 的 <a href="http://www.beforever.com/bashtut.htm" class="printurl">bash介绍 - BeOS的bash教程</a>就是一个非常好的文档。</p>
|
||||
|
||||
<h2>
|
||||
<a href="#"><img src="../images/up.png" style="border:none;float:right" alt="index" /></a>
|
||||
<a id="scripting-bible" name="scripting-bible">脚本圣经</a></h2>
|
||||
<p>在您了解了Shell的基础之后,您可以慢慢的让自己融入脚本的世界。同时,您会在网上或者书店里找到许多相关的教程和参考资料。 其中有一个非常好的介绍资料就是 Scot Hacker的BeOS圣经 中的 <a href="http://www.birdhouse.org/beos/bible/bos/ch_scripting1.html" class="printurl">Scripting Chapter</a>(<a href="http://www.birdhouse.org/beos/bible/bos/BeOS.scripting.PDF">PDF, 900kb</a>),它是专为 Haiku 系统所定制的。</p>
|
||||
<p>在您了解了Shell的基础之后,您可以慢慢的让自己融入脚本的世界。同时,您会在网上或者书店里找到许多相关的教程和参考资料。 其中有一个非常好的介绍资料就是Scot Hacker的BeOS圣经中的 <a href="http://www.birdhouse.org/beos/bible/bos/ch_scripting1.html" class="printurl">Scripting Chapter</a>(<a href="http://www.birdhouse.org/beos/bible/bos/BeOS.scripting.PDF">PDF, 900kb</a>),它是专为 Haiku 系统所定制的。</p>
|
||||
|
||||
<h2>
|
||||
<a href="#"><img src="../images/up.png" style="border:none;float:right" alt="index" /></a><a id="user-scripts" name="user-scripts">Haiku中的脚本</a></h2>
|
||||
<a href="#"><img src="../images/up.png" style="border:none;float:right" alt="index" /></a><a id="user-scripts" name="user-scripts">Haiku的脚本</a></h2>
|
||||
<p>在Haiku系统中,当然也会用到脚本;其中系统的启动和关闭就是典型的脚本程序。这些确定的命令可以由用户脚本来进行扩充。<br />如果它们已经存在,您就需要自己来创建所需的文件。当然,你可以在脚本中适当的位置添加自己希望运行的命令。</p>
|
||||
|
||||
<h3>
|
||||
@@ -81,7 +80,7 @@
|
||||
/boot/system/apps/Workspaces &</pre>
|
||||
<p>需要注意的是,要在命令之后添加 "<tt>&</tt>" 字符,使其作为后台进程运行,否则该脚本将会中止运行直到该命令完成 (这种情况下:已启动的程序将会被关闭)。</p>
|
||||
|
||||
<p>对于上述的启动程序,另一种方式是把它们的快捷方式放入 <span class="path">/boot/home/config/boot/launch</span> 目录。右键点击你希望自动启动的程序,选择 <span class="menu">Create Link</span> ,然后 <a href="tracker.html#navigating">navigating(导航)</a> 至上述目录。</p>
|
||||
<p>对于上述的启动程序,另一种方式是把它们的快捷方式放入 <span class="path">/boot/home/config/boot/launch</span> 目录。右键点击你希望自动启动的程序,选择 <span class="menu">Create Link</span> ,然后<a href="tracker.html#navigating">导航</a>至上述目录。</p>
|
||||
|
||||
<h3>
|
||||
<a href="#"><img src="../images/up.png" style="border:none;float:right" alt="index" /></a>
|
||||
@@ -98,9 +97,9 @@
|
||||
|
||||
<div class="nav">
|
||||
<div class="inner"><span>
|
||||
« <a href="preferences.html">Preferences</a>
|
||||
:: <a href="contents.html" class="uplink">Contents</a>
|
||||
<!-- :: <a href="filesystem-layout.html">Filesystem layout</a> » -->
|
||||
« <a href="preferences.html">首选项</a>
|
||||
:: <a href="contents.html" class="uplink">内容</a>
|
||||
<!-- :: <a href="filesystem-layout.html">文件系统布局</a> » -->
|
||||
</span></div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user