I knew I can do arr=(*.log)
to get all *.log files into arr. But when I try extglob with more complex pattern it seems fail:
$ shopt -s nullglob extglob; x=([a-z][0-9].+([0-9]).*.gz); echo "${x}"; shopt -u nullglob extglob;
-bash: syntax error near unexpected token `('
however without the extglob pattern +(match)
it works:
$ shopt -s nullglob extglob; x=([a-z][0-9].[0-9][0-9].*.gz); echo "${x}"; shopt -u nullglob extglob;
v2.29.2.tar.gz
any suggestion?
You have to dig for it a bit, but the bash wiki says:
Split your sequence of commands up into multiple lines and it should work: