欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

scalar parameter xxxxx created globally in function xxxx

发布时间:2023/12/31 编程问答 47 豆豆
生活随笔 收集整理的这篇文章主要介绍了 scalar parameter xxxxx created globally in function xxxx 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

build_prompt:1: scalar parameter RETVAL created globally in function build_prompt
build_prompt:2: scalar parameter segment created globally in function build_prompt

这个信息总是偶尔出现,

 

解决方案:

local RETVAL

关于segment这个变量的提示信息还没有解决

 

 

build_prompt() {
  RETVAL=$?
  for segment in $BULLETTRAIN_PROMPT_ORDER
  do

    prompt_$segment
  done
  prompt_end
}

 

改为:

 

build_prompt() {
  RETVAL=$?
  local segment
  for segment in $BULLETTRAIN_PROMPT_ORDER
  do

    prompt_$segment
  done
  prompt_end
}

 

 

总结

以上是生活随笔为你收集整理的scalar parameter xxxxx created globally in function xxxx的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。