Ubuntu 的 break 命令的手册在哪里?
我跑
~ master $ man break
No manual entry for break
~ master $ break
break: not in while, until, select, or repeat loop
~ master $
Run Code Online (Sandbox Code Playgroud)
没有手册很难理解命令的目的。它可能链接到内核的 C 代码的 for 循环。我不相信这是 Bash 的突破。
对于 Bash:
$ help break
break: break [n]
Exit for, while, or until loops.
Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing
loops.
Exit Status:
The exit status is 0 unless N is not greater than or equal to 1.
Run Code Online (Sandbox Code Playgroud)
您看到的错误消息是由 Bash 发出的。您试图理解“中断”的上下文是什么?
在 C 中,break是关键字。有关更多信息,请参阅此 wikibook。在某种程度上,它说:
break 语句将立即退出封闭循环。
| 归档时间: |
|
| 查看次数: |
678 次 |
| 最近记录: |