Respostas:
Se você se deu ao trabalho de ler a página de manual em vez de criar enigmas:
Brace Expansion
Brace expansion is a mechanism by which arbitrary strings may be
generated. This mechanism is similar to pathname expansion, but the
filenames generated need not exist.
...
Pathname Expansion
After word splitting, unless the -f option has been set, bash scans
each word for the characters *, ?, and [. If one of these characters
appears, then the word is regarded as a pattern, and replaced with an
alphabetically sorted list of filenames matching the pattern (see
Pattern Matching below). If no matching filenames are found, and the
shell option nullglob is not enabled, the word is left unchanged.
...
Pattern Matching
Any character that appears in a pattern, other than the special pattern
characters described below, matches itself. ...
The special pattern characters have the following meanings:
...
[...] Matches any one of the enclosed characters. A pair of
characters separated by a hyphen denotes a range
expression; any character that falls between those two
characters, inclusive, using the current locale's
collating sequence and character set, is matched.
file[1-3]
expande-se em arquivos nomeados file1
, file2
, file3
. A expansão do nome do arquivo ocorre apenas se existirem arquivos correspondentes. Caso contrário, o padrão é deixado como está. Portanto, com arquivos chamados file1
, file2
, file3
, file[1-3]
expande-se para file1 file2 file3
. Sem esses arquivos, ele não se expande e permanece como file[1-3]
. Com {...}
, os nomes dos arquivos não precisam existir, file{1..3}
expandindo-os para file1 file2 file3
os arquivos presentes ou ausentes.
shopt -s nullglob
antes - você entenderá. Veja mywiki.wooledge.org/glob