Recently Written · git

tmpl

Insanely simple templates

git clone https://github.com/equwal/tmpl

Log | Files | Refs


commit d2e7e3b209612a75925dfacf8571cff5b507a3f8
map588 <map588@pitt.edu>
2026-09-27 02:30:21 -0400

Sort the template list in the C locale

INDEX.md differed between macOS and Linux because sort followed the
locale. LC_ALL=C gives one order everywhere.

 INDEX.md | 4 ++--
 bin/tmpl | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/INDEX.md b/INDEX.md
index df4d387..4a3cc4e 100644
--- a/INDEX.md
+++ b/INDEX.md
@@ -64,10 +64,11 @@ Generated by `make index`. Do not edit by hand.
 | `make/templates/scripts` | include PROJECT=name in your config.mk |
 | `make/variables/globbing` | globbing not done in variable declarations |
 | `openrc.init` | OpenRC service script |
+| `sed/TLDR` |  |
 | `sed/append-after-match` | Append a line after the first line that matches |
 | `sed/bin-sh` | Swap first line for #!/bin/sh naively |
 | `sed/d` | Delete matching lines with D (keeps the newline) or d |
-| `sed/TLDR` |  |
+| `sh/README` |  |
 | `sh/absolute-path` |  |
 | `sh/alias-function-args` | alias argsinmiddle='f(){ echo "$1" "$2" etc. }; f' |
 | `sh/charcount` | cheap hack |
@@ -94,7 +95,6 @@ Generated by `make index`. Do not edit by hand.
 | `sh/random` | 'gawk' can produce random numbers using srand().  In this example, 10 integers between 1 and 500: |
 | `sh/readbyte` | also see: writebyte |
 | `sh/readline` | Read into variables |
-| `sh/README` |  |
 | `sh/redirection` | Cursed shell redirection |
 | `sh/remove-duplicates` | sort the lines, then remove duplicates that are next to eachoter |
 | `sh/str-fn` | Shell function that returns a string by reference |
diff --git a/bin/tmpl b/bin/tmpl
index 07442ec..15d1615 100755
--- a/bin/tmpl
+++ b/bin/tmpl
@@ -24,7 +24,7 @@ list_paths() {
         ! -path '*/.*' ! -path '*/__pycache__/*' \
         ! -path "$root/bin/*" ! -path "$root/tests/*" \
         ! -name '*.py' ! -name '*.md' ! -name Makefile \
-        | sed "s|^$root/||" | sort
+        | sed "s|^$root/||" | LC_ALL=C sort
 }
 
 # Print the summary comment on the first line of a file. A #! line may come first.