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[@]}
  • 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. – DopeGhoti Oct 06 '22 at 04:31
  • All is indicated in the question. I want : cmd /foo/bar/{.php,.css,images/} – Chris972 Oct 06 '22 at 14:08

0 Answers0