-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path19.html
More file actions
278 lines (278 loc) · 22.4 KB
/
Copy path19.html
File metadata and controls
278 lines (278 loc) · 22.4 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="CodeClub - Shell test 命令" />
<meta name="author" content="Jackson" />
<title>Shell test 命令 - CodeClub</title>
<link rel="icon" type="image/x-icon" href="../../img/logo.png" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css"
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
<link rel="stylesheet" href="../../css/main.css" />
<link rel="stylesheet" href="../../css/dark-mode.css" />
<link rel="stylesheet" href="../../css/mobile-optimizations.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/12.0.0/marked.min.js"></script>
<style>
.tutorial-page {
max-width: 1200px;
margin: 70px auto 40px;
padding: 0 20px;
display: flex;
gap: 20px;
}
.tutorial-sidebar {
width: 240px;
flex-shrink: 0;
position: sticky;
top: 70px;
max-height: calc(100vh - 90px);
overflow-y: auto;
background: var(--bg-secondary, #fff);
border-radius: 8px;
padding: 16px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.tutorial-sidebar h3 {
font-size: 15px;
margin: 0 0 12px;
color: var(--text-primary, #1a1a2e);
padding-bottom: 8px;
border-bottom: 2px solid var(--primary, #3b82f6);
}
.tutorial-sidebar a {
display: block;
padding: 5px 8px;
color: var(--text-secondary, #666);
text-decoration: none;
font-size: 13px;
border-radius: 4px;
line-height: 1.4;
}
.tutorial-sidebar a:hover {
background: var(--primary, #3b82f6);
color: #fff;
}
.tutorial-sidebar a.active {
background: var(--primary, #3b82f6);
color: #fff;
font-weight: 600;
}
.tutorial-main {
flex: 1;
min-width: 0;
}
.tutorial-article {
background: var(--bg-secondary, #fff);
border-radius: 8px;
padding: 32px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.tutorial-article h1 {
font-size: 26px;
margin-bottom: 16px;
color: var(--text-primary, #1a1a2e);
border-bottom: 2px solid var(--primary, #3b82f6);
padding-bottom: 12px;
}
.markdown-body {
font-size: 15px;
line-height: 1.8;
color: var(--text-secondary, #333);
}
.markdown-body h1 {
font-size: 24px;
border-bottom: 1px solid var(--border, #e5e7eb);
padding-bottom: 8px;
}
.markdown-body h2 {
font-size: 20px;
border-bottom: 1px solid var(--border, #e5e7eb);
padding-bottom: 6px;
}
.markdown-body h3 {
font-size: 17px;
}
.markdown-body pre {
background: #1e1e2e;
color: #cdd6f4;
padding: 16px;
border-radius: 8px;
overflow-x: auto;
}
.markdown-body code {
font-family: 'Fira Code', 'Cascadia Code', monospace;
font-size: 14px;
}
.markdown-body p code {
background: #f1f5f9;
padding: 2px 6px;
border-radius: 4px;
color: #e83e8c;
}
.markdown-body blockquote {
border-left: 4px solid var(--primary, #3b82f6);
padding: 12px 20px;
margin: 16px 0;
background: #f8fafc;
border-radius: 0 8px 8px 0;
}
.markdown-body img {
max-width: 100%;
border-radius: 8px;
}
.markdown-body table {
border-collapse: collapse;
width: 100%;
margin: 16px 0;
}
.markdown-body table th,
.markdown-body table td {
border: 1px solid var(--border, #e5e7eb);
padding: 8px 12px;
text-align: left;
}
.markdown-body table th {
background: var(--bg-primary, #f8fafc);
font-weight: 600;
}
.markdown-body table tr:nth-child(2n) {
background: var(--bg-primary, #f8fafc);
}
.markdown-body ul,
.markdown-body ol {
padding-left: 24px;
margin: 12px 0;
}
.markdown-body li {
margin: 4px 0;
}
.markdown-body hr {
border: none;
border-top: 1px solid var(--border, #e5e7eb);
margin: 24px 0;
}
.markdown-body a {
color: var(--primary, #3b82f6);
text-decoration: none;
}
.markdown-body a:hover {
text-decoration: underline;
}
.page-navigation {
display: flex;
justify-content: space-between;
margin-top: 24px;
padding-top: 16px;
border-top: 1px solid var(--border, #e5e7eb);
}
.page-nav-link {
color: var(--primary, #3b82f6);
text-decoration: none;
font-weight: 500;
font-size: 14px;
}
.page-nav-link:hover {
text-decoration: underline;
}
.source-link {
margin-top: 16px;
font-size: 13px;
color: var(--text-secondary, #999);
}
.source-link a {
color: var(--primary, #3b82f6);
}
@media (max-width: 768px) {
.tutorial-page {
flex-direction: column;
}
.tutorial-sidebar {
width: 100%;
position: static;
max-height: 200px;
}
}
</style>
</head>
<body>
<nav class="navbar">
<div class="navbar-container">
<a class="navbar-brand" href="../../index.html">
<img src="../../img/logo.png" alt="CodeClub" width="32" height="32" />
<span>CodeClub</span>
</a>
<button class="mobile-menu-toggle" aria-label="切换导航菜单"><span></span><span></span><span></span></button>
<ul class="navbar-nav">
<li><a class="nav-link" href="../../index.html">首页</a></li>
<li><a class="nav-link" href="../../nav.html">网址导航</a></li>
<li><a class="nav-link" href="../../blog/">博客</a></li>
<li><a class="nav-link" href="../../wiki/index.html" target="_blank">WiKi</a></li>
<li><a class="nav-link active" href="../index.html">教程</a></li>
<li><a class="nav-link" href="../../book.html">图书</a></li>
<li><a class="nav-link" href="../../contact.html">联系我</a></li>
<li><a class="nav-link" href="../../about.html">关于我</a></li>
</ul>
</div>
</nav>
<div class="tutorial-page">
<div class="tutorial-sidebar">
<h3>📖 Shell</h3>
<a href="0.html">Linux</a>
<a href="1.html">Linux 简介</a>
<a href="2.html">Linux 安装</a>
<a href="3.html">Linux 云服务器</a>
<a href="4.html">WSL 安装 Linux</a>
<a href="5.html">Linux 系统启动过程</a>
<a href="6.html">Linux 系统目录结构</a>
<a href="7.html">Linux 忘记密码解决方法</a>
<a href="8.html">Linux 远程登录</a>
<a href="9.html">Linux 文件基本属性</a>
<a href="10.html">Linux 文件与目录管理</a>
<a href="11.html">Linux 用户和用户组管理</a>
<a href="12.html">Linux 磁盘管理</a>
<a href="13.html">Linux vi/vim</a>
<a href="14.html">linux yum 命令</a>
<a href="15.html">Linux apt 命令</a>
<a href="16.html">Shell 教程</a>
<a href="17.html">Shell 变量</a>
<a href="18.html">Shell echo 命令</a>
<a href="19.html" class="active">Shell test 命令</a>
<a href="20.html">Shell 流程控制</a>
<a href="21.html">Shell 函数</a>
<a href="22.html">Linux 命令大全</a>
<a href="23.html">Nginx 安装配置</a>
<a href="24.html">MySQL 安装配置</a>
</div>
<div class="tutorial-main">
<div class="tutorial-article">
<div class="markdown-body" id="md-content"></div>
<div class="page-navigation">
<a href="18.html" class="page-nav-link">← Shell echo 命令</a>
<a href="20.html" class="page-nav-link">Shell 流程控制 →</a>
</div>
<div class="source-link">原文来源:<a href="https://www.runoob.com" target="_blank">菜鸟教程</a></div>
</div>
</div>
</div>
<footer class="footer">
<div class="footer-content"><p>© 2024 CodeClub. All rights reserved.</p></div>
</footer>
<script src="../../js/dark-mode.js"></script>
<script src="../../js/mobile-menu.js"></script>
<script>
const md = `# Shell test 命令\n\n\`test\` 命令是 Shell 内置的条件判断工具,用于评估表达式并返回布尔值(真/假),它通常与 \`if\` 语句结合使用,是 Shell 脚本中实现逻辑控制的基础。\n\n\nShell 中的 test 命令用于检查某个条件是否成立,它可以进行数值、字符和文件三个方面的测试。\n\n\n\n### 语法格式\n\n\n\n\`\`\`\ntest EXPRESSION\n# 或\n[ EXPRESSION ] # 注意方括号内必须有空格\n\`\`\`\n\n\n\n---\n\n\n## 文件测试操作\n\n\`test\` 命令最常用于检查文件属性,以下是常用文件测试选项:\n\n\n\n\n\n操作符\n描述\n示例\n\n\n\n-e\n文件是否存在\n\`[ -e file.txt ]\`\n\n\n-f\n是普通文件\n\`[ -f /path/to/file ]\`\n\n\n-d\n是目录\n\`[ -d /path/to/dir ]\`\n\n\n-r\n可读\n\`[ -r file.txt ]\`\n\n\n-w\n可写\n\`[ -w file.txt ]\`\n\n\n-x\n可执行\n\`[ -x script.sh ]\`\n\n\n-s\n文件大小 >0\n\`[ -s logfile ]\`\n\n\n-L\n是符号链接\n\`[ -L symlink ]\`\n\n\n**示例脚本**:\n\n\n\n\n\n## 实例\n\n\n#!/bin/bash**\n\nfile="/etc/passwd"\n\nif [ -e "$file" ]; then\n\n echo "$file 存在"\n\n if [ -r "$file" ]; then\n\n echo "并且可读"\n\n fi\n\nelse\n\n echo "$file 不存在"\n\nfi\n\n\n\n输出结果为:\n\n\n\n\n\`\`\`\n/etc/passwd 存在\n并且可读\n\`\`\`\n\n\n---\n\n\n## 字符串比较\n\n\`test\` 提供了多种字符串比较方式:\n\n\n\n\n\n操作符\n描述\n示例\n\n\n\n-z STRING\n字符串为空\n\`[ -z "$var" ]\`\n\n\n-n STRING\n字符串非空\n\`[ -n "$var" ]\`\n\n\nSTRING1 = STRING2\n字符串相等\n\`[ "$var1" = "$var2" ]\`\n\n\nSTRING1 != STRING2\n字符串不等\n\`[ "$var1" != "$var2" ]\`\n\n\n**重要提示**:字符串变量应该总是用双引号括起来,防止空变量导致语法错误。\n\n\n**示例**:\n\n\n\n\n\n## 实例\n\n\n#!/bin/bash\n\nread -p "输入用户名: " username\n\nif [ -z "$username" ]; then\n\n echo "错误:用户名不能为空"\n\n exit 1\n\nelif [ "$username" = "root" ]; then\n\n echo "警告:不建议使用root账户"\n\nelse\n\n echo "欢迎, $username"\n\nfi\n\n\n\n执行后,我们在终端输入 runoob,输出结果类似如下:\n\n\n\n\n\`\`\`\n输入用户名: runoob\n欢迎, runoob\n\`\`\`\n\n\n---\n\n\n## 数值比较\n\n对于数值比较,\`test\` 使用不同的操作符:\n\n\n\n\n\n操作符\n描述\n示例\n\n\n\n-eq\n等于\n\`[ "$a" -eq "$b" ]\`\n\n\n-ne\n不等于\n\`[ "$a" -ne "$b" ]\`\n\n\n-gt\n大于\n\`[ "$a" -gt "$b" ]\`\n\n\n-ge\n大于或等于\n\`[ "$a" -ge "$b" ]\`\n\n\n-lt\n小于\n\`[ "$a" -lt "$b" ]\`\n\n\n-le\n小于或等于\n\`[ "$a" -le "$b" ]\`\n\n\n**示例**:\n\n\n\n\n\n## 实例\n\n\n#!/bin/bash\n\nread -p "输入年龄: " age\n\nif [ "$age" -lt 0 ]; then\n\n echo "年龄不能为负数"\n\nelif [ "$age" -lt 18 ]; then\n\n echo "未成年人"\n\nelif [ "$age" -ge 18 ] && [ "$age" -lt 60 ]; then\n\n echo "成年人"\n\nelse\n\n echo "老年人"\n\nfi\n\n\n执行后,我们在终端输入 12,输出结果类似如下:\n\n\n\n\n\`\`\`\n输入年龄: 12\n未成年人\n\`\`\`\n\n\n---\n\n\n## 逻辑操作符\n\n\`test\` 支持逻辑组合:\n\n\n\n\n\n操作符\n描述\n示例\n\n\n\n!\n逻辑非\n\`[ ! -f "$file" ]\`\n\n\n-a\n逻辑与\n\`[ "$a" -eq 1 -a "$b" -eq 2 ]\`\n\n\n-o\n逻辑或\n\`[ "$a" -eq 1 -o "$b" -eq 2 ]\`\n\n\n**现代推荐写法**:使用 \`&&\` 和 \`||\` 替代 \`-a\` 和 \`-o\`,更符合 POSIX 标准:\n\n\n\n\n\n## 实例\n\n\n[ "$a" -eq 1 ] && [ "$b" -eq 2 ] # 与\n\n[ "$a" -eq 1 ] || [ "$b" -eq 2 ] # 或\n\n\n\n\n\n---\n\n\n## 高级用法:[[ ]] 和 (( ))\n\nBash 提供了更强大的测试语法:\n\n\n\n### 双括号 [[ ]]\n\n\n\n\n- 支持模式匹配:\`[[ "$var" == *.txt ]]\`\n\n- 支持正则表达式:\`[[ "$var" =~ ^[0-9]+$ ]]\`\n\n- 更安全的字符串处理\n\n\n\n### 算术比较 (( ))\n\n\n\n\n- 专为数值比较设计:\`(( a > b ))\`\n\n- 支持更复杂的算术表达式\n\n\n**示例**:\n\n\n\n\n\n## 实例\n\n\nif [[ "$file" == *.log ]]; then\n\n echo "这是日志文件"\n\nfi\n\nif (( $count > 10 )); then\n\n echo "数量超过10"\n\nfi\n\n\n\n\n\n---\n\n\n## 实际应用示例\n\n\n### 1. 检查服务是否运行\n\n\n\n\n## 实例\n\n\n#!/bin/bash\n\nservice="nginx"\n\nif systemctl is-active --quiet "$service"; then\n\n echo "$service 正在运行"\n\nelse\n\n echo "$service 未运行"\n\n # 可以添加启动服务的命令\n\nfi\n\n\n\n\n\n### 2. 备份文件检查\n\n\n\n\n## 实例\n\n\n#!/bin/bash\n\nbackup_file="/backups/data_$(date +%Y%m%d).tar.gz"\n\nif [ ! -f "$backup_file" ]; then\n\n echo "错误:备份文件 $backup_file 不存在"\n\n exit 1\n\nelif [ ! -s "$backup_file" ]; then\n\n echo "警告:备份文件为空"\n\nelse\n\n echo "备份验证成功"\n\nfi\n\n\n\n\n\n---\n\n\n## 常见错误与调试技巧\n\n\n\n\n- **缺少空格**:\`[ "$a"="$b" ]\` 是错误的,正确是 \`[ "$a" = "$b" ]\`\n\n- **未引用的变量**:\`[ -f $file ]\` 应该为 \`[ -f "$file" ]\`\n\n- **混淆字符串和数值比较**:使用 \`=\` 比较字符串,\`-eq\` 比较数值\n\n\n调试技巧:在脚本开头添加 \`set -x\` 开启调试模式,或使用 \`echo\` 打印测试表达式:\n\n\n\n\n\n## 实例\n\n\necho "测试表达式: [ $a -eq $b ]"\n\n[ "$a" -eq "$b" ] && echo "成立" || echo "不成立"\n\n\n\n \n \n \n \n \n\n \n \n [ Shell 流程控制](http://www.runoob.com/linux/linux-shell-process-control.html)\n \n\n \n \n \n \n \n\n\n\n\n\n \n## \n \n \n \n 5 篇笔记\n 写笔记\n\n\n\n\n\n \n\n #0 Balcon\n\n you***err@163.com\n\n 100**符号含义:**\n\n1. eq (equal的缩写),表示等于为真\n\n2. ne (not equal的缩写),表示不等于为真\n\n3. gt (greater than的缩写),表示大于为真\n\n4. ge (greater&equal的缩写),表示大于等于为真\n\n5. lt (lower than的缩写),表示小于为真\n\n6. le (lower&equal的缩写),表示小于等于为真\n\n[Balcon](https://www.runoob.comjavascript:;) Balcon\n\n you***err@163.com\n\n8年前 (2018-10-28)\n#0 开心小不点儿\n\n swj***1@163.com\n\n 54\n\`\`\`\nresult=$[a + b]\n\`\`\`\n 等同于:\n\n\n\`\`\`\nresult=\`expr $a + $b \`\n\`\`\`\n[开心小不点儿](https://www.runoob.comjavascript:;) 开心小不点儿\n\n swj***1@163.com\n\n7年前 (2019-01-18)\n#0 kaka\n\n 471***508@qq.com\n\n [ 参考地址](https://www.cnblogs.com/37yan/p/6962563.html)\n\n 45**shell 判断文件夹或文件是否存在**\n\n\n文件夹不存在则创建\n\n\n\n\`\`\`\nif [ ! -d "/data/" ];then\n mkdir /data\n else\n echo "文件夹已经存在"\nfi\n\`\`\`\n\n\n文件存在则删除\n\n\n\n\`\`\`\nif [ ! -f "/data/filename" ];then\n echo "文件不存在"\n else\n rm -f /data/filename\nfi\n\`\`\`\n\n\n判断文件夹是否存在\n\n\n\n\`\`\`\nif [ -d "/data/" ];then\n echo "文件夹存在"\n else\n echo "文件夹不存在"\nfi\n\`\`\`\n\n\n判断文件是否存在\n\n\n\n\`\`\`\nif [ -f "/data/filename" ];then\n echo "文件存在"\n else\n echo "文件不存在"\nfi\n\`\`\`\n\n文件比较符\n\n\n\n\`\`\`\n-e 判断对象是否存在\n-d 判断对象是否存在,并且为目录\n-f 判断对象是否存在,并且为常规文件\n-L 判断对象是否存在,并且为符号链接\n-h 判断对象是否存在,并且为软链接\n-s 判断对象是否存在,并且长度不为0\n-r 判断对象是否存在,并且可读\n-w 判断对象是否存在,并且可写\n-x 判断对象是否存在,并且可执行\n-O 判断对象是否存在,并且属于当前用户\n-G 判断对象是否存在,并且属于当前用户组\n-nt 判断file1是否比file2新 [ "/data/file1" -nt "/data/file2" ]\n-ot 判断file1是否比file2旧 [ "/data/file1" -ot "/data/file2" ]\n\`\`\`\n\n[kaka](https://www.runoob.com/note/47027) kaka\n\n 471***508@qq.com\n\n [ 参考地址](https://www.cnblogs.com/37yan/p/6962563.html)\n\n7年前 (2019-09-25)\n#0 矿泉水瓶高高\n\n 181***9007@qq.com\n\n 57除非你清楚自己在干什么,否则请避免在”Shell test命令“中使用单引号**——使用它可能会导致难以察觉的错误,尤其是对于Shell初学者。\n\n让我用下列实例更进一步地解释为什么:\n\n\`\`\`\n\n#! /bin/bash\n# 模拟终端某一指令输出为空时用 test -z 配合单引号进行判断的效果 \nwrong=\`\`\n#注意:反引号内没有任何字符\necho $wrong\nif test -z \'$wrong\'; then\n echo "The result is empty."\nelse\n echo "The result is not empty."\nfi\n\n\`\`\`\n\n执行一下:\n\n\n\n\n\n\`\`\`\n$ ./script-name.sh\nThe result is not empty.\n\`\`\`\n\n执行后的结果与我们所期望的正好**相反**。这是**因为单引号会将其内部的内容原样输出。**\n\n**此时不论**命令的输出**是否****非空,最终都会**被判为**非空。**\n\n而如果你此时没有察觉到错误的根源是单引号,相信我:你会想方设法去掉脚本输出的空格——而空格根本既无法消除又没有实际作用。\n\n[矿泉水瓶高高](https://www.runoob.comjavascript:;) 矿泉水瓶高高\n\n 181***9007@qq.com\n\n6年前 (2020-07-01)\n#0 kkk\n\n 198***2362@qq.com\n\n 32\n\`\`\`\nif [ -d "/data/" ];then\n echo "文件夹存在"\n else\n echo "文件夹不存在"\nfi\n\`\`\`\n\n"/data/" 双引号可以去掉。\n\n\n[] 内部两端要有空格、**-d** 参数和其他内容之间要有空格,\n如果 then 另起一行的话 then 前不需要加 ; 否则需要在 then 前加 ;。\n\n\n\n\n\`\`\`\nif test -d /data/\nthen\n echo \'文件夹存在!\'\nelse\n echo \'文件夹不存在!\'\nfi\n\`\`\`\n\n**-d** 参数和其他内容之间要有空格。\n\n\nthen 要另起一行。\n\n[kkk](https://www.runoob.comjavascript:;) kkk\n\n 198***2362@qq.com\n\n6年前 (2020-08-17)\n \n\n \n \n\n \n \n \n### 点我分享笔记\n\n \n \n \n \n \n \n [取消](https://www.runoob.comjavascript:;)\n\n\n \n \n \n \n \n \n\n\n 分享笔记\n \n \n \n \n \n \n\n 昵称昵称 (必填)\n 邮箱邮箱 (必填)\n 引用地址引用地址\n \n\n \n \n \n \n\n \n \n\n\n\n\n\n\n\n\n\n \n\n \n\n\n\n\n\n\n \n \n \n \n \n \n\n\n \n \n \n \n \n \n \n \n \n\n\n\n\n\n 在线实例\n\n\n ·[HTML 实例](https://www.runoob.com/html/html-examples.html)\n\n\n ·[CSS 实例](https://www.runoob.com/css/css-examples.html)\n\n\n ·[JavaScript 实例](https://www.runoob.com/js/js-examples.html)\n\n\n ·[Ajax 实例](https://www.runoob.com/ajx/ajax-examples.html)\n\n\n ·[jQuery 实例](https://www.runoob.com/jquery/jquery-examples.html)\n\n\n ·[XML 实例](https://www.runoob.com/xml/xml-examples.html)\n\n\n ·[Java 实例](https://www.runoob.com/java/java-examples.html)\n\n\n\n\n\n 字符集&工具\n\n\n · [HTML 字符集设置](https://www.runoob.com/charsets/html-charsets.html)\n\n\n · [HTML ASCII 字符集](https://www.runoob.com/tags/html-ascii.html)\n\n\n · [JS 混淆/加密](https://www.jyshare.com/front-end/6939/)\n\n\n · [PNG/JPEG 图片压缩](https://www.jyshare.com/front-end/6232/)\n\n\n · [HTML 拾色器](https://www.runoob.com/tags/html-colorpicker.html)\n\n\n · [JSON 格式化工具](https://www.jyshare.com/front-end/53)\n\n\n · [随机数生成器](https://www.jyshare.com/front-end/6680/)\n\n\n\n\n 最新更新\n\n\n ·\n [\n OpenCode 自定义... ](http://www.runoob.com/opencode/opencode-custom-tools.html)\n\n\n ·\n [\n OpenCode Skills ](http://www.runoob.com/opencode/opencode-skills.html)\n\n\n ·\n [\n OpenCode MCP 服... ](http://www.runoob.com/opencode/opencode-mcp.html)\n\n\n ·\n [\n OpenCode LSP 服... ](http://www.runoob.com/opencode/opencode-lsp.html)\n\n\n ·\n [\n OpenCode 权限配置 ](http://www.runoob.com/opencode/opencode-permissions.html)\n\n\n ·\n [\n OpenCode 格式化... ](http://www.runoob.com/opencode/opencode-formatter.html)\n\n\n ·\n [\n OpenCode 自定义... ](http://www.runoob.com/opencode/opencode-commands.html)\n\n\n\n\n 站点信息\n\n\n ·\n [意见反馈](https://www.runoob.commailto:admin@runoob.com)\n\n\n ·\n [免责声明](https://www.runoob.com/disclaimer)\n\n\n ·\n [关于我们](https://www.runoob.com/aboutus)\n\n\n ·\n [文章归档](https://www.runoob.com/archives)\n\n\n\n\n\n\n\n **关注微信**\n\n\n\n \n\n\n\n\n\n\n Copyright © 2013-2026 **[菜鸟教程](https://www.runoob.com//www.runoob.com/)** \n **[runoob.com](https://www.runoob.com//www.runoob.com/)** All Rights Reserved. 备案号:[闽ICP备15012807号-1](https://beian.miit.gov.cn/)\n\n\n\n [ ](https://www.runoob.comjavascript:void(0))\n [](https://www.runoob.comjavascript:void(0))\n [](https://www.runoob.comjavascript:void(0))\n\n\n\n#### 微信关注\n\n `;
document.getElementById('md-content').innerHTML = marked.parse(md);
</script>
</body>
</html>