OILS / demo / glob-sort-order.sh View on Github | oilshell.org

43 lines, 23 significant
1#!/usr/bin/env bash
2#
3# Usage:
4# ./glob-sort-order.sh <function name>
5
6set -o nounset
7set -o pipefail
8set -o errexit
9
10demo() {
11 local dir=_tmp/glob-sort-order
12 mkdir -p $dir
13 cd $dir
14
15
16 echo LANG=${LANG:-}
17 echo LC_ALL=${LC_ALL:-}
18 echo LC_COLLATE=${LC_COLLATE:-}
19
20 touch ':' '_' '{}' '&' '<'
21
22 # default
23 echo *
24
25 export LC_COLLATE=C
26 echo *
27
28 export LC_ALL=C
29 echo *
30
31 # same as above
32 export LC_ALL=C.UTF-8
33 echo *
34
35 export LC_COLLATE=en_US.UTF_8
36 echo *
37
38 # Hm the united states one is different!
39 export LC_ALL=en_US.UTF_8
40 echo *
41}
42
43"$@"