【问题标题】:iTerm2 "bad floating point constant" on startupiTerm2 启动时“错误的浮点常量”
【发布时间】:2022-11-20 19:02:04
【问题描述】:

我不确定这是否是发布此问题的正确位置。

我最近安装了 iTerm 2 和 shell 集成。 但是,我在启动时不断收到错误/警告:

> /Users/usr/.iterm2_shell_integration.zsh:32: bad floating point constant

第32行的.iterm2_shell_integration.zsh有如下代码:

ver=$(printf "%.0f" $(sw_vers | grep ProductVersion | cut -d':' -f2 | tr -d ' ' | sed -e 's/ //g'))
zsh: bad floating point constant

我不确定是否存在错误或我的设置是否有问题。

构建版本是3.4.18我在 MacOS Ventura 13.0.1 上运行它。

【问题讨论】:

    标签: macos terminal zsh iterm2


    【解决方案1】:

    ver 尝试检索您的主要操作系统版本,在您的情况下,它应该是 13。

    尝试注释第 32 行,而不是配置:

    ver=13
    

    或者你可以自己修复这条线,MacOS 13 中很可能有一些东西被替换了/新的,所以试着打开一个终端并分开执行这些命令,看看它在哪里出错:

    sw_vers
    sw_vers | grep ProductVersion
    sw_vers | grep ProductVersion | cut -d':' -f2
    sw_vers | grep ProductVersion | cut -d':' -f2 | tr -d ' '
    sw_vers | grep ProductVersion | cut -d':' -f2 | tr -d ' ' | sed -e 's/ //g'
    printf "%.0f" $(sw_vers | grep ProductVersion | cut -d':' -f2 | tr -d ' ' | sed -e 's/ //g')
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多