[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Glob expansion sort order
From: |
Philip Couling |
Subject: |
Glob expansion sort order |
Date: |
Sun, 10 Sep 2023 20:15:39 +0100 |
Is the result of glob expansion sorted?
Assuming regexp is installed, you can loop through files:
for file in (hd0,gpt1)/foo/*
do
echo $file
done
I'd like to ensure the loop always executes in reverse text sort order
(foo, bar not bar, foo). So far experiments have all resulted in that
order but I'm not sure if I'm seeing the result of reading files in the
order that the file system happens to have recorded them, or if grub is
deliberately sorting them.
If it's not sorted, how can I sort them?
- Glob expansion sort order,
Philip Couling <=