About FreeBSD disk slice/partition naming - slice

I am newbie in using FreeBSD. I read some material saying that disk partitioning is different from windows and linux, that disks are firstly "sliced" and then "partitioned" within each slice. So I got an impression that slices in FreeBSD is partitions in windows/linux. For a disk on SCSI controller (say da0), its slices should be named as da0s0, da0s1, da0s2, da0s3... For each slice, its partition are "labeled" by a letter from 'a' to 'h', and there is a conventional meaning for some letters (e.g., 'c' represents the whole slice)...so far so good...
But today on a FreeBSD system I see some different naming (i.e., 'p' is shown in place of 's'):
crw-r----- 1 root operator 0x48 Oct 10 22:52 /dev/da0
root#spa:~ # ls -la /dev/da0*
crw-r----- 1 root operator 0x48 Oct 10 22:52 /dev/da0
crw-r----- 1 root operator 0x49 Oct 10 22:52 /dev/da0p1
crw-r----- 1 root operator 0x4a Oct 10 22:52 /dev/da0p2
root#spa:~ # ls -la /dev/da1*
crw-r----- 1 root operator 0x4b Oct 10 22:52 /dev/da1
crw-r----- 1 root operator 0x53 Oct 10 22:52 /dev/da1p2
crw-r----- 1 root operator 0x57 Oct 10 22:52 /dev/da1p22
crw-r----- 1 root operator 0x58 Oct 10 22:52 /dev/da1p23
crw-r----- 1 root operator 0x54 Oct 10 22:52 /dev/da1p3
crw-r----- 1 root operator 0x55 Oct 10 22:52 /dev/da1p4
crw-r----- 1 root operator 0x5a Oct 10 22:53 /dev/da1p41
crw-r----- 1 root operator 0x52 Oct 10 22:52 /dev/da1s1
crw-r----- 1 root operator 0x56 Oct 10 22:52 /dev/da1s21
crw-r----- 1 root operator 0x59 Oct 10 22:52 /dev/da1s30
btw, it also seems that slices/partitions name with 'p' are related to ZFS...
I want to know some background information about those 'p' naming conventions, and how 'p' is supposed to be coeixst with 's' names.
Thanks a lot,
/bruin

The letter comes from partition scheme being used. 'p' is used for GPT and 's' for MBR and, probably, everything else.

Related

bash console output print layout

I want to make my writing to the console output in a nice tidy human readable.
here is how it looks now:
====================== Sat Apr 16 12:57:17 EDT 2022 ======================
==========================================================================
====================== Leopard - Download from S3 ======================
==========================================================================
==========================================================================
====================== Leopard - Decompressing ======================
==========================================================================
total 1349872
drwxr-xr-x 2 root root 12288 Apr 16 12:57 .
drwxrwxrwt. 4 root root 102 Apr 16 12:57 ..
-rw-r--r-- 1 root root 185070885 Apr 16 12:03 asdasdasd.sql.gz
-rw-r--r-- 1 root root 40344632 Apr 16 12:03 asdasdas.sql.gz
-rw-r--r-- 1 root root 26631 Apr 16 12:03 asdad.sql.gz
-rw-r--r-- 1 root root 1679 Apr 16 12:03 asdasd.sql.gz
-rw-r--r-- 1 root root 1237 Apr 16 12:03 asd.sql.gz
-rw-r--r-- 1 root root 5241900 Apr 16 12:03 asdasd.sql.gz
-rw-r--r-- 1 root root 1144 Apr 16 12:03 asdasasd.sql.gz
-rw-r--r-- 1 root root 489312 Apr 16 12:03 asdasd.sql.gz
-rw-r--r-- 1 root root 1138 Apr 16 12:03 asdasdasd.sql.gz
==========================================================================
====================== NewYorkCity - Download from S3 ======================
==========================================================================
==========================================================================
====================== NewYorkCity - Unloading SSL Example ======================
==========================================================================
total 1349872
drwxr-xr-x 2 root root 12288 Apr 16 12:57 .
drwxrwxrwt. 4 root root 102 Apr 16 12:57 ..
-rw-r--r-- 1 root root 185070885 Apr 16 12:03 asdasdasd.sql.gz
-rw-r--r-- 1 root root 40344632 Apr 16 12:03 asdasdas.sql.gz
-rw-r--r-- 1 root root 26631 Apr 16 12:03 asdad.sql.gz
-rw-r--r-- 1 root root 1679 Apr 16 12:03 asdasd.sql.gz
-rw-r--r-- 1 root root 1237 Apr 16 12:03 asd.sql.gz
-rw-r--r-- 1 root root 5241900 Apr 16 12:03 asdasd.sql.gz
-rw-r--r-- 1 root root 1144 Apr 16 12:03 asdasasd.sql.gz
-rw-r--r-- 1 root root 489312 Apr 16 12:03 asdasd.sql.gz
-rw-r--r-- 1 root root 1138 Apr 16 12:03 asdasdasd.sql.gz
I want that all the === line will be in the same length, and the text always in the center with 1 space on each side
Will appreciate assistance here :)
UPDATE / EDIT:
The original script is something like that:
eecho () { echo ==========================================================================; }
echo_stage () {
START=1
END=11
for (( c=$START; c<=$END; c++ ))
do
printf == '-%.0s'
done
echo -n " " $1 " "
for (( c=$START; c<=$END; c++ ))
do
printf == '-%.0s'
done
echo
}
stage() {
eecho
echo_stage "$1" "$2"
eecho
}
print_date () { echo "======================" $(date) "======================"; }
reload_db() {
print_date
rm -rf /var/tmp/db
mkdir -p /var/tmp/db
stage "DB - Download from S3"
aws s3 sync s3://db-backup/latest/ /var/tmp/db --profile=papilon --quiet
stage "DB - Decompressing"
pigz -d /var/tmp/db/*
stage "DB - Restoring Data"
cd /var/tmp/db
stage "DB - Restoring Tables"
for i in `ls -1 *.sql | grep -v "_view.sql"`;do echo $i;mysql db < $i;done
stage "DB - Restoring Views"
for i in `ls -1 *.sql | grep "_view.sql"`;do echo $i;mysql db < $i;done
stage "DB - Clean up"
rm -rf /var/tmp/db
print_date
}
reload_db
This awk filter will size your === padding correctly, and align titles to the center, if you pipe your command output through it:
# cmd |
awk '
BEGIN {a[1] = "="}
NF>1 && $1~/^=+$/ && $NF~/^=+$/ {
sub(/^=+/, "")
sub(/=+$/, "")
title_len=length($0)
pad = ""
for (i=1; i<=(74-title_len)/2; ++i) {
pad=pad"="
}
$0 = pad $0 pad a[title_len%2]
}
1'
This doesn't wrap the ls -l output, only the titles. It assumes 74 is hardcoded as the length of the solid === lines (and doesn't change depending on terminal size). The array a is used to add an extra = when 74 - title_len is an odd number.
Example output:
====================== Sat Apr 16 12:57:17 EDT 2022 ======================
==========================================================================
====================== Leopard - Download from S3 ======================
==========================================================================
==========================================================================
======================= Leopard - Decompressing ========================
==========================================================================
total 1349872
drwxr-xr-x 2 root root 12288 Apr 16 12:57 .
drwxrwxrwt. 4 root root 102 Apr 16 12:57 ..
-rw-r--r-- 1 root root 185070885 Apr 16 12:03 asdasdasd.sql.gz
-rw-r--r-- 1 root root 40344632 Apr 16 12:03 asdasdas.sql.gz
-rw-r--r-- 1 root root 26631 Apr 16 12:03 asdad.sql.gz
-rw-r--r-- 1 root root 1679 Apr 16 12:03 asdasd.sql.gz
-rw-r--r-- 1 root root 1237 Apr 16 12:03 asd.sql.gz
-rw-r--r-- 1 root root 5241900 Apr 16 12:03 asdasd.sql.gz
-rw-r--r-- 1 root root 1144 Apr 16 12:03 asdasasd.sql.gz
-rw-r--r-- 1 root root 489312 Apr 16 12:03 asdasd.sql.gz
-rw-r--r-- 1 root root 1138 Apr 16 12:03 asdasdasd.sql.gz
==========================================================================
==================== NewYorkCity - Download from S3 ====================
==========================================================================
==========================================================================
================= NewYorkCity - Unloading SSL Example ==================
==========================================================================
total 1349872
drwxr-xr-x 2 root root 12288 Apr 16 12:57 .
drwxrwxrwt. 4 root root 102 Apr 16 12:57 ..
-rw-r--r-- 1 root root 185070885 Apr 16 12:03 asdasdasd.sql.gz
-rw-r--r-- 1 root root 40344632 Apr 16 12:03 asdasdas.sql.gz
-rw-r--r-- 1 root root 26631 Apr 16 12:03 asdad.sql.gz
-rw-r--r-- 1 root root 1679 Apr 16 12:03 asdasd.sql.gz
-rw-r--r-- 1 root root 1237 Apr 16 12:03 asd.sql.gz
-rw-r--r-- 1 root root 5241900 Apr 16 12:03 asdasd.sql.gz
-rw-r--r-- 1 root root 1144 Apr 16 12:03 asdasasd.sql.gz
-rw-r--r-- 1 root root 489312 Apr 16 12:03 asdasd.sql.gz
-rw-r--r-- 1 root root 1138 Apr 16 12:03 asdasdasd.sql.gz
Because you have now posted your script, I will add a new answer for pure bash.
title() {
local text pad
(( ${#1} > 70 )) && { echo "$1"; return; }
text=${1:+ }$1${1:+ }
pad=$( eval "printf %.1s ={1..$(( ( 74 - ${#text} ) / 2 ))}" )
echo "$pad$text$pad$( (( ${#text} % 2 )) && printf = )"
}
For title 'foo bar', this function prints foo bar (or any string up to 70 characters) with a space either side, centered and padded to 74 columns with =. If the string is longer than 70 characters it's too long to pad, so it's printed as is.
================================ foo bar =================================
With no argument, or an empty argument, it prints a solid line of 74 =:
==========================================================================
You can swap = for any single ASCII character.
You can swap 74 for any even number. Also for an odd number, if you change && printf to || printf in the last line. (also change the 70 to N - 4)
You can call title once for the date, or three times for the larger three line banners (see banner below).
Explanation:
${#text} is bash for "length of $text".
${1:+ } expands to a space, unless $1 is empty or unset. This allows us to add spaces to either end of the string, or exclude them for an empty string.
={1..10} expands to =1 =2 =3 ... =10, and printf %.1s prints the first character of each string. Combining these allows us to repeat a string (=) N times.
But we can't use a variable (or arithmetic) in {1..10} normally. So we need eval.
You probably heard eval is bad, and a security risk. That's often true, but here we are not passing any unknown data to eval (such as user input), and it's safe from code injection. (${#text} always expands to a single number)
So we make two bars, of length (74 - text-length) / 2, adding another = to the second bar if the text length is an odd number.
I also made a few changes to your script which you might consider. Apart from the date and titles, these have nothing to do with the padding. The title and banner functions will work on your old script.
title() {
local text pad
(( ${#1} > 70 )) && { echo "$1"; return; }
text="${1:+ }$1${1:+ }"
pad=$( eval "printf %.1s ={1..$(( ( 74 - ${#text} ) / 2 ))}" )
echo "$pad$text$pad$( (( ${#text} % 2 )) && printf = )"
}
banner() {
title
title "$1"
title
}
reload_db() {
local i
title "$(date)"
rm -rf /var/tmp/db || exit 1
mkdir -p /var/tmp/db || exit 1
banner 'DB - Download from S3'
aws s3 sync s3://db-backup/latest/ /var/tmp/db --profile=papilon --quiet
banner 'DB - Decompressing'
pigz -d /var/tmp/db/*
banner 'DB - Restoring Data'
cd /var/tmp/db || exit 1
banner 'DB - Restoring Tables'
GLOBIGNORE='*_view.sql'
for i in *.sql; do
echo "$i"
mysql db < "$i"
done
GLOBIGNORE=
banner 'DB - Restoring Views'
for i in *_view.sql; do
echo "$i"
mysql db < "$i"
done
banner 'DB - Clean up'
rm -rf /var/tmp/db
title "$(date)"
}
At the very least, you should exit early if cd, mkdir, or the first rm fail. Also, looping over an unquoted ls command sub is a bad idea. Instead you can use glob expansion (or find).
You could also concatenate the SQL scripts, but this only works if all the commands end with a semicolon (see Run multiple sql files in mysql batch):
big_title 'DB - Restoring Tables'
GLOBIGNORE='*_view.sql'
printf '%s\n' *.sql
cat *.sql | mysql db
GLOBIGNORE=
big_title 'DB - Restoring Views'
printf '%s\n' *_view.sql
cat *_view.sql | mysql db

Make nl to enumerate from a specified line

I intent to enumerate the files and dirs
[root#iz2ze9wve43n2nyuvmsfx5z /]# ls -lh |nl
1 total 60K
2 lrwxrwxrwx 1 root root 7 Jun 15 22:08 bin -> usr/bin
3 dr-xr-xr-x. 5 root root 4.0K Jun 15 22:10 boot
4 drwxr-xr-x 19 root root 2.9K Sep 17 11:35 dev
5 drwxr-xr-x. 85 root root 4.0K Sep 18 22:44 etc
6 drwxr-xr-x. 2 root root 4.0K Sep 17 08:25 home
7 lrwxrwxrwx 1 root root 7 Jun 15 22:08 lib -> usr/lib
8 lrwxrwxrwx 1 root root 9 Jun 15 22:08 lib64 -> usr/lib64
9 drwx------. 2 root root 16K Oct 15 2017 lost+found
10 drwxr-xr-x. 2 root root 4.0K Apr 11 2018 media
11 drwxr-xr-x. 2 root root 4.0K Apr 11 2018 mnt
12 drwxr-xr-x. 2 root root 4.0K Apr 11 2018 opt
13 dr-xr-xr-x 86 root root 0 Sep 17 11:35 proc
14 drwxrwxrwx. 21 root root 4.0K Oct 22 08:11 root
15 drwxr-xr-x 24 root root 660 Oct 24 19:10 run
16 lrwxrwxrwx 1 root root 8 Jun 15 22:08 sbin -> usr/sbin
17 drwxr-xr-x. 2 root root 4.0K Apr 11 2018 srv
18 dr-xr-xr-x 13 root root 0 Oct 21 19:50 sys
19 drwxrwxrwt. 11 root root 4.0K Oct 24 05:19 tmp
20 drwxr-xr-x. 13 root root 4.0K Jun 15 22:08 usr
21 drwxr-xr-x. 19 root root 4.0K Jun 15 22:08 var
It starts with 1 which I desire is 0.
How could make nl to enumerate from a specified line.
You just need to use the -v option, and specify to start from 0; your instruction becoming:
ls -lh |nl -v 0
Lets have a look at nl --help:
$ nl --help
Usage: nl [OPTION]... [FILE]...
Write each FILE to standard output, with line numbers added.
With no FILE, or when FILE is -, read standard input.
Mandatory arguments to long options are mandatory for short options too.
...
-v, --starting-line-number=NUMBER first line number for each section
Therefore:
$ nl -v0 <<EOF
> a
> b
> EOF
0 a
1 b
Note that it does not really matter whether you want to enumerate directories or anything else, which is why you probably should strip this part from your question to make it more specific.

How does Dir.entries() determine the order of the listed files in the array? [duplicate]

This question already has answers here:
Sort order in `Dir.entries`
(3 answers)
Closed 4 years ago.
In my /Users/name/website/posts directory I have the following files:
$ ls -la
total 56
5 name staff 160B 16 Apr 20:48 .
3 name staff 96B 16 Apr 20:48 ..
1 name staff 6.5K 16 Apr 20:47 bar.md
1 name staff 11K 16 Apr 20:47 baz.md
1 name staff 4.2K 16 Apr 20:47 foo.md
With this IRB session:
base = "/Users/name/website/posts"
#=> "/Users/bc/website/posts"
entries = Dir.entries(base)
#=> [".", "..", "bar.md", "foo.md", "baz.md"]
How is the order of the returned array determined?
Although specific Ruby implementations may have their specific logic, it is arbitrary from the point of view of the specification.

rsync: failed to set times on "/cygdrive/e/.": Invalid argument (22)

I get the below error message when I try to rsync from a local hard disk to a USB disk mounted at E: on Windows 10.
rsync: failed to set times on "/cygdrive/e/.": Invalid argument (22)
My rsync command is as below (path shortened for brevity):
rsync -rtv --delete --progress --modify-window=5 /cygdrive/d/path/to/folder/ /cygdrive/e/
I actually need to set modification times (on directories as well) and rsync actually sets modification times perfectly. It only fails to set times on root of the USB disk.
I experienced exactly the same problem.
I created a dir containing one text file and when trying to rsync it to an removable (USB) drive, I got the error. However, the file was copied to the destination. The problem is not reproducible if the destination is a folder (other than root) on the removable drive
I then repeated the process using a fixed drive as destination, and the problem was not reproducible
The 1st difference that popped up between the 2 drives, was the file system (for more details, check [MS.Docs]: File Systems Technologies):
FAT32 - on the removable drive
NTFS - on the fixed one
So this was the cause of my failure. Formatting the USB drive as NTFS fixed the problem:
The USB drive formatted as FAT32 (default):
cfati#cfati-e5550-0 /cygdrive/e/Work/Dev/StackOverflow/q045006385
$ ll /cygdrive/
total 20
dr-xr-xr-x 1 cfati None 0 Jul 14 17:58 .
drwxrwx---+ 1 cfati None 0 Jun 9 15:04 ..
d---r-x---+ 1 NT SERVICE+TrustedInstaller NT SERVICE+TrustedInstaller 0 Jul 13 22:21 c
drwxrwx---+ 1 SYSTEM SYSTEM 0 Jul 14 13:19 e
drwxr-xr-x 1 cfati None 0 Dec 31 1979 n
drwxr-xr-x 1 cfati None 0 Dec 31 1979 w
cfati#cfati-e5550-0 /cygdrive/e/Work/Dev/StackOverflow/q045006385
$ rsync -rtv --progress --modify-window=5 ./dir/ /cygdrive/w
sending incremental file list
rsync: failed to set times on "/cygdrive/w/.": Invalid argument (22)
./
a.txt
3 100% 0.00kB/s 0:00:00 (xfr#1, to-chk=0/2)
sent 111 bytes received 111 bytes 444.00 bytes/sec
total size is 3 speedup is 0.01
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1196) [sender=3.1.2]
cfati#cfati-e5550-0 /cygdrive/e/Work/Dev/StackOverflow/q045006385
$ ll /cygdrive/
total 20
dr-xr-xr-x 1 cfati None 0 Jul 14 17:58 .
drwxrwx---+ 1 cfati None 0 Jun 9 15:04 ..
d---r-x---+ 1 NT SERVICE+TrustedInstaller NT SERVICE+TrustedInstaller 0 Jul 13 22:21 c
drwxrwx---+ 1 SYSTEM SYSTEM 0 Jul 14 13:19 e
drwxr-xr-x 1 cfati None 0 Dec 31 1979 n
drwxr-xr-x 1 cfati None 0 Dec 31 1979 w
After formatting the USB drive as NTFS:
cfati#cfati-e5550-0 /cygdrive/e/Work/Dev/StackOverflow/q045006385
$ ll /cygdrive/
total 24
dr-xr-xr-x 1 cfati None 0 Jul 14 17:59 .
drwxrwx---+ 1 cfati None 0 Jun 9 15:04 ..
d---r-x---+ 1 NT SERVICE+TrustedInstaller NT SERVICE+TrustedInstaller 0 Jul 13 22:21 c
drwxrwx---+ 1 SYSTEM SYSTEM 0 Jul 14 13:19 e
drwxr-xr-x 1 cfati None 0 Dec 31 1979 n
drwxrwxrwx+ 1 Administrators Administrators 0 Jul 14 17:59 w
cfati#cfati-e5550-0 /cygdrive/e/Work/Dev/StackOverflow/q045006385
$ rsync -rtv --progress --modify-window=5 ./dir/ /cygdrive/w
sending incremental file list
./
a.txt
3 100% 0.00kB/s 0:00:00 (xfr#1, to-chk=0/2)
sent 111 bytes received 38 bytes 298.00 bytes/sec
total size is 3 speedup is 0.02
cfati#cfati-e5550-0 /cygdrive/e/Work/Dev/StackOverflow/q045006385
$ ll /cygdrive/
total 24
dr-xr-xr-x 1 cfati None 0 Jul 14 17:59 .
drwxrwx---+ 1 cfati None 0 Jun 9 15:04 ..
d---r-x---+ 1 NT SERVICE+TrustedInstaller NT SERVICE+TrustedInstaller 0 Jul 13 22:21 c
drwxrwx---+ 1 SYSTEM SYSTEM 0 Jul 14 13:19 e
drwxr-xr-x 1 cfati None 0 Dec 31 1979 n
drwxrwxrwx+ 1 Administrators Administrators 0 Jul 14 13:19 w
As a side note, when I was at step #2., I was an idiot and kept the --delete arg, so til I hit Ctrl + C, it deleted some data. Luckily, it didn't get to delete crucial files / folders.

Bash locale sensitive globbing on OS X

Scenario on both Linux(CentOS) and OS X(Yosemite):
$ touch A B C X Y Z a b c x y z
$ locale
LC_ALL=en_GB.UTF-8
On OS X I am using a case-sensitive filesystem.
Bash 4.1.2 on Linux:
$ echo [A-Z]
A b B c C x X y Y z Z
This is the expected output, the LC_COLLATE for this locale is followed.
Bash 4.3.39 on OS X:
$ echo [A-Z]
A B C X Y Z
This appears to be the same as locale ANSI, C, or POSIX. So, it looks like on OS X the locale is ignored by globbing.
Why is it inconsistent? Is there any way to get the locale sensitive result on OS X?
Edit:
OS X: LC_ALL is explicitly set in .bash_profile using:
export LC_ALL=en_GB.UTF-8
locale on OS X:
bash-4.3$ locale
LANG="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_CTYPE="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_ALL="en_GB.UTF-8"
locale on Linux:
$ locale
LANG=en_US.utf8
LC_CTYPE="en_GB.utf8"
LC_NUMERIC="en_GB.utf8"
LC_TIME="en_GB.utf8"
LC_COLLATE="en_GB.utf8"
LC_MONETARY="en_GB.utf8"
LC_MESSAGES="en_GB.utf8"
LC_PAPER="en_GB.utf8"
LC_NAME="en_GB.utf8"
LC_ADDRESS="en_GB.utf8"
LC_TELEPHONE="en_GB.utf8"
LC_MEASUREMENT="en_GB.utf8"
LC_IDENTIFICATION="en_GB.utf8"
LC_ALL=en_GB.utf8
Edit
Format of the filesystem is Mac OS Extended (Case-sensitive, Journaled).
#chepner suggested that I didn't have separate files on OS X. Two things here, the inodes are different, and the glob construct ? gave all the files in upper and lower case:
bash-4.3$ ls -li ?
559 -rw-r--r-- 1 clivedarke staff 0 Aug 4 17:23 A
560 -rw-r--r-- 1 clivedarke staff 0 Aug 4 17:23 B
561 -rw-r--r-- 1 clivedarke staff 0 Aug 4 17:23 C
562 -rw-r--r-- 1 clivedarke staff 0 Aug 4 17:23 X
563 -rw-r--r-- 1 clivedarke staff 0 Aug 4 17:23 Y
564 -rw-r--r-- 1 clivedarke staff 0 Aug 4 17:23 Z
565 -rw-r--r-- 1 clivedarke staff 0 Aug 4 17:23 a
566 -rw-r--r-- 1 clivedarke staff 0 Aug 4 17:23 b
567 -rw-r--r-- 1 clivedarke staff 0 Aug 4 17:23 c
568 -rw-r--r-- 1 clivedarke staff 0 Aug 4 17:23 x
569 -rw-r--r-- 1 clivedarke staff 0 Aug 4 17:23 y
570 -rw-r--r-- 1 clivedarke staff 0 Aug 4 17:23 z
Also:
bash-4.3$ echo 'lower' > a
bash-4.3$ echo 'upper' > A
bash-4.3$ cat a
lower
bash-4.3$ cat A
upper
bash-4.3$ diff a A
1c1
< lower
---
> upper
Digging int the source code I found in bash-4.3/lib/glob/smatch.c the following comment:
/* We use strcoll(3) for range comparisons in bracket expressions,
even though it can have unwanted side effects in locales
other than POSIX or US. For instance, in the de locale, [A-Z] matches
all characters. If GLOB_ASCIIRANGE is non-zero, and we're not forcing
the use of strcoll (e.g., for explicit collating symbols), we use
straight ordering as if in the C locale. */
In configure I found:
--enable-glob-asciiranges-default
force bracket range expressions in pattern matching
to use the C locale by default
So I guess that was set when compiled. Need more digging.

Resources