Artificial intelligent assistant

alphabetical expansion order for * When I'm using a POSIX compliant shell (es: dash, bash, zsh, ...) can I be sure that `*` will always expand in alphabetical order (dictated by `LC_COLLATE`)? example: $ echo 1 > file_a $ echo 2 > file_b $ echo 3 > file_c $ cat * 1 2 3

That behavior is required by POSIX, and you're safe to rely on it.

Another note that you want to set your locale to `C` to get consistent behavior. In locale with collation elements have the same sorting order, you will have strange result.

On GNU system with UTF-8 locale:


$ printf '%b\
' '\U2461' '\U2460' | sort




or:


$ printf '%s\
' A B a b | sort
a
A
b
B


Setting to `C` locale:


$ printf '%b\
' '\U2461' '\U2460' | LC_ALL=C sort



$ printf '%s\
' A B a b | LC_ALL=C sort
A
B
a
b


Some shells even do not support multibyte characters like `dash`, `mksh` or support but will choke on invalid sequences of bytes like `yash`.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 2b70b71978254f01de504f38a3375ac7