O problema é com o $ extra na frente de f1 . Experimente:
test1=${f1/$f2/${f3:t}}
Digamos que eu tenha o seguinte
$f1=/some/path
$f2=/some/subpath
$f3=/some/other/subpath
Se eu tentar:
test1=${$f1/$f2/${f3:t}}
zsh reclama com bad substitution .
No entanto:
test2=${f3:t}
funciona bem. O que estou fazendo errado?
Tags zsh variable-substitution