什么是 Bash 的 string{ending1,ending2} 构造,zsh 中的等价物是什么?

Sha*_*off 5 bash zsh

我一直在尝试切换到 zsh。到目前为止我错过的东西是这样的:

#!/bin/bash
mv /very/long/path/to/file1.conf{,.old}
#bash expandes that to:
mv /very/long/path/to/file1.conf /very/long/path/to/file1.conf.old
Run Code Online (Sandbox Code Playgroud)

那叫什么,是否有 zsh 等价物?

enz*_*tib 6

它被称为支撑扩展,也存在于zsh.

bash 和 zsh 之间的一个重要区别是,在 zsh 中,参数扩展是在大括号内执行的,但在 bash 中并非如此。