SuperScript

Blog

Locale for Sorting

Today I ran afoul of a problem that I first encountered over 20 years ago: non-portable sort. Back in the early aughts the symptom was that on Linux with a en_US.UTF-8 locale i < j < k did not hold in sort. This was on Linux. We worked around this by setting locale to C for…

Bhyve and Grub

In attempting to install linux (Debian in this case) under bhyve I sought out and followed the common guidance: use uefi and not grub. https://vermaden.wordpress.com/2023/08/18/freebsd-bhyve-virtualization/ https://forums.freebsd.org/threads/handbook-bhyve-linux-example.92193/ h…

Poll0

In a pipeline you may have one segment that must wait for input before executing. Think xargs but passing data through rather than using it as command-line arguments. Today I addressed this with a simple C program, called poll0. It polls file descriptor 0 and exits 0 if data is r…

Kakoune Filetype Mode

The Kakoune editor has a very simple and powerful mechanism to specify a hierarchy of key bindings. It is quite common to map the space character in normal mode to commands that include many mode selectors, leading to additional mappings. Dynamic key bindings are usually implemen…

Shell Help

In keeping with my simple approach to documentation in makefiles I do the same thing in shell scripts with this implementation: #_# help #_# Print this helpful message do_help() { sed -n 's/^#_#/ /p' "$0" } The function name follows the mode-function pattern…