加入收藏 | 设为首页 | 会员中心 | 我要投稿 大庆站长网 (https://www.0459zz.com/)- 科技、智能边缘云、事件网格、云计算、站长网!
当前位置: 首页 > 综合聚焦 > Linux > 正文

linux – Bash“declare -A”在macOS上不起作用

发布时间:2021-01-11 19:04:28 所属栏目:Linux 来源:互联网
导读:我猜是 Bash没有在macOS上更新.当谷歌搜索更新Bash macOS时,我不断收到错误修复补丁.无论如何,我需要在macOS Bash中使用关联数组,其中命令: declare -A 产生错误: -bash: declare: -A: invalid option declare: usage: declare [-afFirtx] [-p] [name[=valu

我猜是 Bash没有在macOS上更新.当谷歌搜索更新Bash macOS时,我不断收到错误修复补丁.无论如何,我需要在macOS Bash中使用关联数组,其中命令:

declare -A

产生错误:

-bash: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] …]

我有优胜美地.

解决方法

declare -A(关联数组)是bash 4的一个特性.

OS X bash很可能是3.X.

我不知道OS X有关于bash 4的官方更新.

BREW /等.可能会.

(编辑:大庆站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读