首页 > 解决方案 > Bash 5 - 未找到 mapfile / readarray 命令

问题描述

我在 MacOS Cagalina 10.15.4 上。我认为 mapfile 和 readarray 可用于 Bash 4 及更高版本,但低于。请问我做错了什么?

$ brew install bash
$ bash --version
GNU bash, version 5.0.17(1)-release (x86_64-apple-darwin19.4.0)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

$ mapfile
-bash: mapfile: command not found

$ readarray
-bash: readarray: command not found

标签: bash

解决方案


推荐阅读