0

Say I have the following

$f1=/some/path
$f2=/some/subpath
$f3=/some/other/subpath

If I try:

test1=${$f1/$f2/${f3:t}}

zsh complains with bad substitution.

However:

test2=${f3:t}

works well. What am I doing wrong?

1
  • ${file:t:r} is how to combine modifiers in parameter expansions. ${file:t:r} removes the path and removes the extension from file. Commented Feb 26, 2024 at 8:52

1 Answer 1

2

The problem is with the extra $ in front of f1. Try:

test1=${f1/$f2/${f3:t}}
0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.