0

I have a command (zip, but nevermind) in which I have a parameter like

cmd /foo/bar/{*.php,*.css,images/}

I would like to put it in a variable to pass it to the command as :

VAR=/foo/bar/{*.php,*.css,images/}
cmd ${VAR}

But, whatever I try, it never expand as I want. I tried with or without quotes, but not better.

EDIT:

(No answer possible because closed) I hadn't been able to find it, but the solution did exist:

VAR=(/foo/bar/{*.php,*.css,images/})
cmd ${VAR[@]}
2
  • Please be specific. Don't say "it does not do what I want." Specify what you do want, and show what your attempt does (and indeed what you attempted), so that the contrast between what was desired and what is created is explicit. Commented Oct 6, 2022 at 4:31
  • All is indicated in the question. I want : cmd /foo/bar/{.php,.css,images/} Commented Oct 6, 2022 at 14:08

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.