3 ms·
Brackets have a special meaning in the UNIX shell since the earliest times. Together with "*" and "?", the brackets "[" and "]" have been used by the UNIX shel
by adrian_b 2y ago
Brackets have a special meaning in the UNIX shell since the earliest times.
Together with "*" and "?", the brackets "[" and "]" have been used by the UNIX shell since some of its earliest versions (already many years before the Bourne shell) in pattern matching for pathname expansion (globbing).
For example, if you have in a directory 3 files named "file1", "file2" and "file3", then
"ls file?" will output
file1 file2 file3
while "ls file[13]" will output
file1 file3
- teo_zero 2y agoYes, of course I was too quick: I was trying to suggest to use a single bracket char in the command just as TFA uses the comma. But it turned out that an opening bracket wouldn't work with some non-bash shells. So I was doubly wrong.