2 added 307 characters in body
source | link

From bash documentation, Brace Expansion section:

Brace expansion is performed before any other expansions, and any characters special to other expansions are preserved in the result. It is strictly textual. Bash does not apply any syntactic interpretation to the context of the expansion or the text between the braces. To avoid conflicts with parameter expansion, the string ‘${’ is not considered eligible for brace expansion.

InAnother note, in bash:

The order of expansions is: brace expansion, tilde expansion, parameter, variable, and arithmetic expansion and command substitution (done in a left-to-right fashion), word splitting, and filename expansion.

So in your case, bash saw brace expansion before variable expansion, it will do brace expansion first, produce result {Alpha,Bravo,Charlie}.

If you can control $find_dir variable content, you can use eval:

eval "find Directory/{$find_dir} arg1 arg2"

From bash documentation, Brace Expansion section:

Brace expansion is performed before any other expansions, and any characters special to other expansions are preserved in the result. It is strictly textual. Bash does not apply any syntactic interpretation to the context of the expansion or the text between the braces. To avoid conflicts with parameter expansion, the string ‘${’ is not considered eligible for brace expansion.

In your case, bash will do brace expansion first, produce result {Alpha,Bravo,Charlie}.

If you can control $find_dir variable content, you can use eval:

eval "find Directory/{$find_dir} arg1 arg2"

From bash documentation, Brace Expansion section:

Brace expansion is performed before any other expansions, and any characters special to other expansions are preserved in the result. It is strictly textual. Bash does not apply any syntactic interpretation to the context of the expansion or the text between the braces. To avoid conflicts with parameter expansion, the string ‘${’ is not considered eligible for brace expansion.

Another note, in bash:

The order of expansions is: brace expansion, tilde expansion, parameter, variable, and arithmetic expansion and command substitution (done in a left-to-right fashion), word splitting, and filename expansion.

So in your case, bash saw brace expansion before variable expansion, it will do brace expansion first, produce result {Alpha,Bravo,Charlie}.

If you can control $find_dir variable content, you can use eval:

eval "find Directory/{$find_dir} arg1 arg2"
1
source | link

From bash documentation, Brace Expansion section:

Brace expansion is performed before any other expansions, and any characters special to other expansions are preserved in the result. It is strictly textual. Bash does not apply any syntactic interpretation to the context of the expansion or the text between the braces. To avoid conflicts with parameter expansion, the string ‘${’ is not considered eligible for brace expansion.

In your case, bash will do brace expansion first, produce result {Alpha,Bravo,Charlie}.

If you can control $find_dir variable content, you can use eval:

eval "find Directory/{$find_dir} arg1 arg2"