以下是linux脚本的顶部含义是什么?
#!/bin/bash
return &> /dev/null
Run Code Online (Sandbox Code Playgroud)
return 应该从bash函数返回值.
如果在你的例子中使用完全没有&> /dev/null,那么它是无效的,因为return它不属于bash函数的主体,并且会打印:
line 2: return: can only `return' from a function or sourced script
Run Code Online (Sandbox Code Playgroud)
但是,有人决定通过管道输出隐藏该错误消息/dev/null.
换句话说,这一切都没有多大意义.
| 归档时间: |
|
| 查看次数: |
205 次 |
| 最近记录: |