I am trying to use brace expansion in a bash script as follows.
#!/bin/bash
document_root="/var/www/www.example.com"
`chmod -R g+w $document_root/{../captcha,../files}`
this gives me the error
chmod: cannot access `/var/www/www.example.com/{../captcha,../files}': No such file or directory
but when I run this in a terminal it works just fine.
#!/bin/bash
document_root="/var/www/www.example.com"
chmod -R g+w $document_root/{../captcha,../files}
$
when you are assigning to a variable, only when expanding