<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>http://hlt.suda.edu.cn/index.php?action=history&amp;feed=atom&amp;title=Linux-2020-spring-5-6</id>
	<title>Linux-2020-spring-5-6 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="http://hlt.suda.edu.cn/index.php?action=history&amp;feed=atom&amp;title=Linux-2020-spring-5-6"/>
	<link rel="alternate" type="text/html" href="http://hlt.suda.edu.cn/index.php?title=Linux-2020-spring-5-6&amp;action=history"/>
	<updated>2026-11-06T01:48:21Z</updated>
	<subtitle>本wiki的该页面的版本历史</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>http://hlt.suda.edu.cn/index.php?title=Linux-2020-spring-5-6&amp;diff=2210&amp;oldid=prev</id>
		<title>Zhli：/* shell 脚本 */</title>
		<link rel="alternate" type="text/html" href="http://hlt.suda.edu.cn/index.php?title=Linux-2020-spring-5-6&amp;diff=2210&amp;oldid=prev"/>
		<updated>2020-05-06T23:10:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;shell 脚本&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2020年5月6日 (三) 23:10的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l99&quot; &gt;第99行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第99行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;安装：sudo apt-get install rand&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;安装：sudo apt-get install rand&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;unset一个变量名时，语法为unset x，注意不能有取值符，unset x[3]，表示删除数组x的第3个元素&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Zhli</name></author>
	</entry>
	<entry>
		<id>http://hlt.suda.edu.cn/index.php?title=Linux-2020-spring-5-6&amp;diff=2209&amp;oldid=prev</id>
		<title>Zhli：/* shell 脚本 */</title>
		<link rel="alternate" type="text/html" href="http://hlt.suda.edu.cn/index.php?title=Linux-2020-spring-5-6&amp;diff=2209&amp;oldid=prev"/>
		<updated>2020-05-06T23:09:26Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;shell 脚本&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2020年5月6日 (三) 23:09的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l6&quot; &gt;第6行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第6行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== shell 脚本 ==  &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== shell 脚本 ==  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &amp;lt;nowiki&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;shell脚本我有讲义，可以看。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;shell脚本我有讲义，可以看。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l99&quot; &gt;第99行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第100行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;安装：sudo apt-get install rand&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;安装：sudo apt-get install rand&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;bash-script-part1.mp4&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/nowiki&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;bash-script-part2-declare-and-environment-var.mp4&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;bash-script-part3-and-assignment.mp4&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Zhli</name></author>
	</entry>
	<entry>
		<id>http://hlt.suda.edu.cn/index.php?title=Linux-2020-spring-5-6&amp;diff=2208&amp;oldid=prev</id>
		<title>Zhli：/* shell 脚本 */</title>
		<link rel="alternate" type="text/html" href="http://hlt.suda.edu.cn/index.php?title=Linux-2020-spring-5-6&amp;diff=2208&amp;oldid=prev"/>
		<updated>2020-05-06T03:57:26Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;shell 脚本&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2020年5月6日 (三) 03:57的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l93&quot; &gt;第93行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第93行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;思考：&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;思考：&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;创建100个文件夹命名000-&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;099，每一个文件夹内创建一个txt文件，命名为1&lt;/del&gt;.txt-99.txt，每个文件写入一个随机整数（rand命令），将所有的随机数排序（降序），输出格式（printf命令）：&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;创建100个文件夹命名000-&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;099，每一个文件夹内创建一个txt文件，命名为0&lt;/ins&gt;.txt-99.txt，每个文件写入一个随机整数（rand命令），将所有的随机数排序（降序），输出格式（printf命令）：&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;9734 : 7.txt&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;9734 : 7.txt&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;9324 ：33.txt&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;9324 ：33.txt&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Zhli</name></author>
	</entry>
	<entry>
		<id>http://hlt.suda.edu.cn/index.php?title=Linux-2020-spring-5-6&amp;diff=2181&amp;oldid=prev</id>
		<title>Zhli：创建页面，内容为“== 复习 ==   遗留问题：同时做很多文件的覆盖： 2000/01/2000-01-25.output.txt -&gt; 2000/01/2000-01-25.txt（用前者来覆盖后者）   == shell 脚...”</title>
		<link rel="alternate" type="text/html" href="http://hlt.suda.edu.cn/index.php?title=Linux-2020-spring-5-6&amp;diff=2181&amp;oldid=prev"/>
		<updated>2020-04-28T01:10:23Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“== 复习 ==   遗留问题：同时做很多文件的覆盖： 2000/01/2000-01-25.output.txt -&amp;gt; 2000/01/2000-01-25.txt（用前者来覆盖后者）   == shell 脚...”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== 复习 == &lt;br /&gt;
&lt;br /&gt;
遗留问题：同时做很多文件的覆盖： 2000/01/2000-01-25.output.txt -&amp;gt; 2000/01/2000-01-25.txt（用前者来覆盖后者）&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== shell 脚本 == &lt;br /&gt;
&lt;br /&gt;
shell脚本我有讲义，可以看。&lt;br /&gt;
&lt;br /&gt;
script脚本&lt;br /&gt;
&lt;br /&gt;
program程序&lt;br /&gt;
&lt;br /&gt;
code代码&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
解释型语言特点：&lt;br /&gt;
1.解释器（interpreter）按语句逐条执行&lt;br /&gt;
2.语法/运行时的错误只有执行到的时候才会报&lt;br /&gt;
3.优化的余地不大&lt;br /&gt;
&lt;br /&gt;
编译型语言特点&lt;br /&gt;
1.编译器一次性读入源代码，编译（compile）每一个.c文件--&amp;gt;.o文件（二进制文件、机器代码），链接（link）*.o --&amp;gt; .exe&lt;br /&gt;
2.语法错误立刻报&lt;br /&gt;
3.优化可以很充分&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
一般来说，解释型语言写的程序叫做脚本。（脚本特点：小）&lt;br /&gt;
&lt;br /&gt;
shell中数据类型有两种：Integer和String&lt;br /&gt;
（默认都是String，在没有歧义的情况下不用加引号）&lt;br /&gt;
ex.  v=&amp;quot;I love teaching&amp;quot;&lt;br /&gt;
&lt;br /&gt;
赋值语句：x=3（等号左右不能有空格）y=5&lt;br /&gt;
$:取值符  用法${}（当不歧义时不用加{}）&lt;br /&gt;
	echo $x&lt;br /&gt;
字符串拼接：k=$x$y&lt;br /&gt;
数值运算：k=$(($x+$y))&lt;br /&gt;
&lt;br /&gt;
思考：&lt;br /&gt;
m=&amp;quot;$x+$y=$(($x+$y))&amp;quot;&lt;br /&gt;
m='$x+$y=$(($x+$y))'&lt;br /&gt;
&lt;br /&gt;
*关于shell中的变量&lt;br /&gt;
1.默认都是字符串&lt;br /&gt;
2.declare -i 整数类型&lt;br /&gt;
3.如果做整数运算，会把非整数都理解为0&lt;br /&gt;
4.declare +i 把变量的整数属性去掉&lt;br /&gt;
5.unset删除一个变量&lt;br /&gt;
6.echo $notexistvar 等价于 echo $emptystrvar（空字符串）&lt;br /&gt;
7.declare -r var （read-only）等价于 const int i = 1;&lt;br /&gt;
8.环境变量：指可以继承给儿子进程的变量&lt;br /&gt;
	export x 或 declare -x x&lt;br /&gt;
  注：shell中的继承只能通过环境变量&lt;br /&gt;
9.数组变量&lt;br /&gt;
	a=(A B C 1 2 30)&lt;br /&gt;
	echo ${a[0]}&lt;br /&gt;
数组长度：echo ${#a[@]}&lt;br /&gt;
增加元素：a[100]=40&lt;br /&gt;
总结&lt;br /&gt;
a.下标可以不连续&lt;br /&gt;
b.下标不合法输出空字符串&lt;br /&gt;
c.{#a[@]表示数组长度&lt;br /&gt;
10.特殊变量&lt;br /&gt;
$变量：当前shell的进程编号&lt;br /&gt;
?变量：返回上个命令的状态编号（上个命令执行成功返回0，未成功返回大于0）&lt;br /&gt;
11.把命令结果保存到变量中&lt;br /&gt;
a.$(cmd)	例：a=$(ls)&lt;br /&gt;
b.`cmd`	例：a=`date +%y-%m-%d`&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
test命令&lt;br /&gt;
a.判断文件类型、存在、时间比较、权限&lt;br /&gt;
b.比较字符串或证书&lt;br /&gt;
&lt;br /&gt;
test -e /bin/ls：-e是否存在&lt;br /&gt;
&lt;br /&gt;
与条件语句合用：&lt;br /&gt;
if test -e /bin/ls; then echo &amp;quot;exist: /bin/ls&amp;quot;; fi&lt;br /&gt;
if [ -e /bin/ls ]; then echo &amp;quot;exist: /bin/ls&amp;quot;; fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
shell中的循环&lt;br /&gt;
while循环&lt;br /&gt;
for循环&lt;br /&gt;
&lt;br /&gt;
*上节课思考题：&lt;br /&gt;
for f in `find . -name '*output*txt'`&lt;br /&gt;
do&lt;br /&gt;
	newf=`echo $f | sed 's/.output//'`;&lt;br /&gt;
	mv $f $newf;&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
思考：&lt;br /&gt;
创建100个文件夹命名000-099，每一个文件夹内创建一个txt文件，命名为1.txt-99.txt，每个文件写入一个随机整数（rand命令），将所有的随机数排序（降序），输出格式（printf命令）：&lt;br /&gt;
9734 : 7.txt&lt;br /&gt;
9324 ：33.txt&lt;br /&gt;
&lt;br /&gt;
安装：sudo apt-get install rand&lt;br /&gt;
&lt;br /&gt;
bash-script-part1.mp4&lt;br /&gt;
bash-script-part2-declare-and-environment-var.mp4&lt;br /&gt;
bash-script-part3-and-assignment.mp4&lt;/div&gt;</summary>
		<author><name>Zhli</name></author>
	</entry>
</feed>