forked from netkiller/netkiller.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
78 lines (46 loc) · 13.3 KB
/
Copy pathindex.html
File metadata and controls
78 lines (46 loc) · 13.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>第 1 章 Bash Shell</title><link rel="stylesheet" type="text/css" href="..//docbook.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><meta name="keywords" content="shell,bash,zsh, awk,sed,curl,expect, grep,sort" /><link rel="home" href="../index.html" title="Netkiller Linux Shell 手札" /><link rel="up" href="../index.html" title="Netkiller Linux Shell 手札" /><link rel="prev" href="../preface.download.html" title="1.4. 文档下载" /><link rel="next" href="introduction.html" title="1.2. Introduction" /></head><body><a xmlns="" href="http://www.netkiller.cn/">Home</a> |
<a xmlns="" href="http://netkiller.github.io/">简体中文</a> |
<a xmlns="" href="http://netkiller.sourceforge.net/">繁体中文</a> |
<a xmlns="" href="/journal/index.html">杂文</a> |
<a xmlns="" href="/search.html">Search</a> |
<a xmlns="" href="http://netkiller-github-com.iteye.com/">ITEYE 博客</a> |
<a xmlns="" href="http://my.oschina.net/neochen/">OSChina 博客</a> |
<a xmlns="" href="https://www.facebook.com/bg7nyt">Facebook</a> |
<a xmlns="" href="http://cn.linkedin.com/in/netkiller/">Linkedin</a> |
<a xmlns="" href="https://zb.oschina.net/profile/725072/market">作品与服务</a> |
<a xmlns="" href="mailto:netkiller@msn.com">Email</a><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">第 1 章 Bash Shell</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="../preface.download.html">上一页</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="introduction.html">下一页</a></td></tr></table><hr /></div><table xmlns=""><tr><td><iframe src="http://ghbtns.com/github-btn.html?user=netkiller&repo=netkiller.github.io&type=watch&count=true&size=large" height="30" width="170" frameborder="0" scrolling="0" style="width:170px; height: 30px;" allowTransparency="true"></iframe></td><td><iframe src="http://ghbtns.com/github-btn.html?user=netkiller&repo=netkiller.github.io&type=fork&count=true&size=large" height="30" width="170" frameborder="0" scrolling="0" style="width:170px; height: 30px;" allowTransparency="true"></iframe></td><td><iframe src="http://ghbtns.com/github-btn.html?user=netkiller&type=follow&count=true&size=large" height="30" width="240" frameborder="0" scrolling="0" style="width:240px; height: 30px;" allowTransparency="true"></iframe></td></tr></table><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="index"></a>第 1 章 Bash Shell</h1></div></div></div><div class="toc"><p><strong>目录</strong></p><dl class="toc"><dt><span class="section"><a href="index.html#option">1.1. bash - GNU Bourne-Again SHell</a></span></dt><dd><dl><dt><span class="section"><a href="index.html#idm45249931829072">1.1.1. -n 检查脚本是否有语法错误</a></span></dt><dt><span class="section"><a href="index.html#idm45249931827600">1.1.2. -x 显示详细运行过程</a></span></dt></dl></dd><dt><span class="section"><a href="introduction.html">1.2. Introduction</a></span></dt><dd><dl><dt><span class="section"><a href="introduction.html#commands.chsh">1.2.1. chsh - change login shell</a></span></dt><dt><span class="section"><a href="introduction.html#test">1.2.2. test 命令</a></span></dt><dt><span class="section"><a href="introduction.html#stdin-stdout-stderr">1.2.3. I/O 重定向</a></span></dt><dd><dl><dt><span class="section"><a href="introduction.html#idm45249931813856">1.2.3.1. error 重定向</a></span></dt><dt><span class="section"><a href="introduction.html#idm45249931812480">1.2.3.2. 使用块记录日志</a></span></dt><dt><span class="section"><a href="introduction.html#tee">1.2.3.3. tee - read from standard input and write to standard output and files</a></span></dt><dt><span class="section"><a href="introduction.html#idm45249931807792">1.2.3.4. 创建文件</a></span></dt><dt><span class="section"><a href="introduction.html#idm45249931806288">1.2.3.5. 快速清空一个文件的内容</a></span></dt></dl></dd><dt><span class="section"><a href="introduction.html#pipes">1.2.4. pipes (FIFOs)</a></span></dt><dt><span class="section"><a href="introduction.html#mktemp">1.2.5. mktemp - create a temporary file or directory 临时目录与文件</a></span></dt><dt><span class="section"><a href="introduction.html#history">1.2.6. History 命令历史记录</a></span></dt><dd><dl><dt><span class="section"><a href="introduction.html#idm45249931794224">1.2.6.1. .bash_history</a></span></dt><dt><span class="section"><a href="introduction.html#idm45249931785744">1.2.6.2. .mysql_history</a></span></dt></dl></dd><dt><span class="section"><a href="introduction.html#hash">1.2.7. hash - hash database access method</a></span></dt><dt><span class="section"><a href="introduction.html#prompt">1.2.8. prompt</a></span></dt></dl></dd><dt><span class="section"><a href="variable.html">1.3. variable</a></span></dt><dd><dl><dt><span class="section"><a href="variable.html#expression">1.3.1. 表达式</a></span></dt><dt><span class="section"><a href="variable.html#environment">1.3.2. Internal Environment Variables</a></span></dt><dt><span class="section"><a href="variable.html#variable.set">1.3.3. set 设置变量</a></span></dt><dt><span class="section"><a href="variable.html#unset">1.3.4. unset 变量销毁</a></span></dt><dt><span class="section"><a href="variable.html#variable.default">1.3.5. 设置变量默认值</a></span></dt><dt><span class="section"><a href="variable.html#variable.export">1.3.6. export 设置全局变量</a></span></dt><dt><span class="section"><a href="variable.html#variable.declare">1.3.7. declare</a></span></dt><dt><span class="section"><a href="variable.html#variable.system">1.3.8. 系统变量</a></span></dt><dt><span class="section"><a href="variable.html#variable.number">1.3.9. Numerical 数值运算</a></span></dt><dt><span class="section"><a href="variable.html#variable.strings">1.3.10. Strings 字符串操作</a></span></dt><dd><dl><dt><span class="section"><a href="variable.html#idm45249931726752">1.3.10.1. ##/#</a></span></dt><dt><span class="section"><a href="variable.html#idm45249931724272">1.3.10.2. %%/%</a></span></dt><dt><span class="section"><a href="variable.html#idm45249931722288">1.3.10.3. :n1:n2</a></span></dt><dt><span class="section"><a href="variable.html#idm45249931720336">1.3.10.4. #</a></span></dt><dt><span class="section"><a href="variable.html#idm45249931718944">1.3.10.5. example</a></span></dt><dt><span class="section"><a href="variable.html#string.len">1.3.10.6. 计算字符串长度</a></span></dt><dt><span class="section"><a href="variable.html#idm45249931715168">1.3.10.7. 字符串查找替换</a></span></dt></dl></dd><dt><span class="section"><a href="variable.html#variable.array">1.3.11. Array 数组</a></span></dt><dd><dl><dt><span class="section"><a href="variable.html#idm45249931706912">1.3.11.1. 拆分字符串并转换为数组</a></span></dt><dt><span class="section"><a href="variable.html#idm45249931702864">1.3.11.2. 数组转为字符串</a></span></dt></dl></dd><dt><span class="section"><a href="variable.html#eval">1.3.12. eval</a></span></dt></dl></dd><dt><span class="section"><a href="conditions.html">1.4. conditions if and case</a></span></dt><dd><dl><dt><span class="section"><a href="conditions.html#if">1.4.1. if</a></span></dt><dt><span class="section"><a href="conditions.html#case">1.4.2. case</a></span></dt></dl></dd><dt><span class="section"><a href="loop.html">1.5. Loops for, while and until</a></span></dt><dd><dl><dt><span class="section"><a href="loop.html#for">1.5.1. for</a></span></dt><dt><span class="section"><a href="loop.html#while">1.5.2. while</a></span></dt><dt><span class="section"><a href="loop.html#until">1.5.3. until</a></span></dt></dl></dd><dt><span class="section"><a href="functions.html">1.6. Functions</a></span></dt><dd><dl><dt><span class="section"><a href="functions.html#idm45249931607744">1.6.1. Local variables</a></span></dt></dl></dd><dt><span class="section"><a href="select.html">1.7. User interfaces</a></span></dt><dd><dl><dt><span class="section"><a href="select.html#idm45249931599040">1.7.1. input</a></span></dt></dl></dd><dt><span class="section"><a href="example.html">1.8. Example</a></span></dt><dd><dl><dt><span class="section"><a href="example.html#idm45249931593616">1.8.1. 有趣的Shell</a></span></dt><dt><span class="section"><a href="example.html#example.backup">1.8.2. backup</a></span></dt><dt><span class="section"><a href="example.html#example.cpuinfo">1.8.3. CPU 核心数</a></span></dt><dt><span class="section"><a href="example.html#example.password">1.8.4. Password</a></span></dt><dt><span class="section"><a href="example.html#processes">1.8.5. processes</a></span></dt><dd><dl><dt><span class="section"><a href="example.html#idm45249931583840">1.8.5.1. pid</a></span></dt><dt><span class="section"><a href="example.html#idm45249931581984">1.8.5.2. kill</a></span></dt><dt><span class="section"><a href="example.html#idm45249931580128">1.8.5.3. pgrep</a></span></dt></dl></dd><dt><span class="section"><a href="example.html#example1">1.8.6. Shell 技巧</a></span></dt><dd><dl><dt><span class="section"><a href="example.html#idm45249931577440">1.8.6.1. 行转列,再批评</a></span></dt><dt><span class="section"><a href="example.html#idm45249931576064">1.8.6.2. for vs while</a></span></dt><dt><span class="section"><a href="example.html#idm45249931573696">1.8.6.3. 遍历字符串</a></span></dt></dl></dd><dt><span class="section"><a href="example.html#idm45249931572064">1.8.7. to convert utf-8 from gb2312 code</a></span></dt><dt><span class="section"><a href="example.html#idm45249931570544">1.8.8. 使用内存的百分比 </a></span></dt><dt><span class="section"><a href="example.html#idm45249931569136">1.8.9. 合并apache被cronlog分割的log文件</a></span></dt></dl></dd></dl></div>
<div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="option"></a>1.1. bash - GNU Bourne-Again SHell</h2></div></div></div>
<div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="idm45249931829072"></a>1.1.1. -n 检查脚本是否有语法错误</h3></div></div></div>
<pre class="screen">
</pre>
</div>
<div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="idm45249931827600"></a>1.1.2. -x 显示详细运行过程</h3></div></div></div>
<pre class="screen">
</pre>
</div>
</div>
</div><div xmlns="" id="disqus_thread"></div><script xmlns="" type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
//if(document.domain == 'netkiller.github.io'){
var disqus_shortname = 'netkiller'; // required: replace example with your forum shortname
//}else{
//var disqus_shortname = 'neochan';
//}
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script><noscript xmlns="">Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript><a xmlns="" href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a><br xmlns="" /><script xmlns="" type="text/javascript" id="clustrmaps" src="//cdn.clustrmaps.com/map_v2.js?u=r5HG&d=9mi5r_kkDC8uxG8HuY3p4-2qgeeVypAK9vMD-2P6BYM"></script><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="../preface.download.html">上一页</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="introduction.html">下一页</a></td></tr><tr><td width="40%" align="left" valign="top">1.4. 文档下载 </td><td width="20%" align="center"><a accesskey="h" href="../index.html">起始页</a></td><td width="40%" align="right" valign="top"> 1.2. Introduction</td></tr></table></div><script xmlns="">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-11694057-1', 'auto');
ga('send', 'pageview');
</script><script xmlns="" type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F997cd4a7320a82d72cb74d179118f697' type='text/javascript'%3E%3C/script%3E"));
</script><script xmlns="" type="text/javascript" src="/js/q.js"></script></body></html>