Please explain why 1 4 5 6 is displayed for the last four echo statements? I hit this by accident once, but I am now curious as to why this behavior occurs.
These statements work as expected (for me).
$ echo [ 9876543210 ]
[ 9876543210 ]
$ echo [237890]
[237890]
These echo statements consistently display 1 4 5 6. Is there something special about these numbers?
$ echo [9876543210]
1 4 5 6
$ echo [abcd9876543210ghi]
1 4 5 6
$ echo [-123456-]
1 4 5 6
$ echo [-7654321-]
1 4 5 6
Thanks!
- The possible duplicate is related and helpful, but not a duplicate. The possible duplicate is from the perspective of an
rmcommand. This question is from the perspective of a perceived "weird behavior" of anechocommand. The underlying answer for both is globbing. Someone searching for issues with anechocommand would not easily find thermquestion, but would more likely land here.