Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a2346f6

Browse filesBrowse files
authored
Create true.md
创建文件
1 parent 556c11c commit a2346f6
Copy full SHA for a2346f6

1 file changed

+37Lines changed: 37 additions & 0 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎command/true.md‎

Copy file name to clipboard
+37Lines changed: 37 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
true
2+
===
3+
4+
返回状态为成功。
5+
6+
## 概要
7+
8+
```shell
9+
true
10+
```
11+
12+
## 主要用途
13+
14+
- 用于和其他命令进行逻辑运算。
15+
16+
## 返回值
17+
18+
返回状态总是成功;返回值为0。
19+
20+
## 例子
21+
22+
```shell
23+
# 当你的脚本设置set -e时,任何返回值为失败的命令都会使得脚本退出。
24+
set -e
25+
# 如何临时跳过呢?下面的语句使用逻辑或操作符连接true,返回值一定为真。
26+
some_command || true
27+
28+
# 当然,和python的pass一样,也可以用作条件语句临时占位。
29+
```
30+
31+
32+
### 注意
33+
34+
1. 该命令是bash内建命令,相关的帮助信息请查看`help`命令。
35+
36+
37+
<!-- Linux命令行搜索引擎:https://jaywcjlove.github.io/linux-command/ -->

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.