Bash – Bash’s string{ending1,ending2} construct called and what is the equivalent in zsh

bashzsh

I've been trying to switch to zsh. Something I've missed so far is this:

#!/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

What is that called, and is there a zsh equivalent?

Best Answer

It is called Brace Expansion and is present also in zsh.

One important difference between bash and zsh is that in zsh parameter expansion is performed inside braces, but in bash this is not the case.

Related Question