mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
Merge pull request #9961 from wxy/20180819-How-to-define-and-use-functions-in-Linux-Shell-Script
PRF:20180819 How to define and use functions in Linux Shell Script
This commit is contained in:
commit
8af449c4f7
@ -106,7 +106,7 @@ function func_return_value {
|
||||
}
|
||||
```
|
||||
|
||||
上面的函数向调用者返回 10。让我们执行这个函数:
|
||||
上面的函数向调用者返回 `10`。让我们执行这个函数:
|
||||
|
||||
```
|
||||
$ func_return_value
|
||||
@ -119,7 +119,7 @@ $ echo "Value returned by function is: $?"
|
||||
Value returned by function is: 10
|
||||
```
|
||||
|
||||
**提示**:在 Bash 中使用 `$?` 去获取函数的返回值
|
||||
**提示**:在 Bash 中使用 `$?` 去获取函数的返回值。
|
||||
|
||||
### 函数技巧
|
||||
|
Loading…
Reference in New Issue
Block a user