On Mon, Jun 16, 2025 at 1:57 PM Zachary Santer <zsan...@gmail.com> wrote: > > You can't combine multiple forms of parameter expansion into one thing > like this. If name is unset, "${name-//\"/}" will do what the > ${parameter-word} expansion does and expand to //"/. > > If you want the combined effect of multiple forms of parameter > expansion, you're going to have to use multiple parameter expansions. > In your case, that would probably look like this: > name="${name-}" > name="${name//\"/}"
If bash were to support multiple forms of parameter expansion in one expansion, that could potentially be written in a nested fashion, like "${{paramter-word}/pattern/string}" but, uh, definitely not a necessity. Probably not great for readability.