如何在Zsh中为数组的每个元素添加一个单词?

我在Zsh做过:
array={geometry,analysis,topology,graph theory,calculus}
echo $array

然后我想在“math:calculus”这样的每个元素中添加单词“math:”:

while (( i++ < 10)); { echo math:$array[i] }

但它不起作用?为什么?

解决方法

在zsh中工作正常,分配更改为:
array={geometry,calculus}

array=(geometry,calculus)

但是zsh有很多改变其行为的选择.也许输出’setopt’可能会有所帮助.

相关文章

1、安装Apache。 1)执行如下命令,安装Apache服务及其扩展包...
一、先说一下用ansible批量采集机器信息的实现办法: 1、先把...
安装配置 1. 安装vsftpd 检查是否安装了vsftpd # rpm -qa | ...
如何抑制stable_secret读取关键的“net.ipv6.conf.all.stabl...
1 删除0字节文件 find -type f -size 0 -exec rm -rf {} ...
## 步骤 1:安装必要的软件包 首先,需要确保系统已安装 `dh...