返回是啥意思?

Posted

技术标签:

【中文标题】返回是啥意思?【英文标题】:What does return mean?返回是什么意思? 【发布时间】:2018-06-09 03:04:15 【问题描述】:

我正在分析一个 shell 脚本,但我对下面的代码有点困惑。

谁能解释一下 return; 在这种情况下做了什么?

if [ -f "$BYPASS_EXISTING_NETWORK_TEST_FILE" ]; then

      dloginfo "Skipping existing network test; mandated by configuration."
      # Consume the file.
      rm -f "$BYPASS_EXISTING_NETWORK_TEST_FILE"
      return;
fi 

【问题讨论】:

help return ... 请修正格式。 Difference between return and exit in BASH functions的可能重复 【参考方案1】:

return 将从函数返回一个值。

来自help return的信息

【讨论】:

以上是关于返回是啥意思?的主要内容,如果未能解决你的问题,请参考以下文章