diff --git a/homepage/software/index.m4 b/homepage/software/index.m4 index f3779a1..c6c0ba4 100644 --- a/homepage/software/index.m4 +++ b/homepage/software/index.m4 @@ -4,6 +4,7 @@ define(`_TITLE', `guide to software')dnl define(`_DESCRIPTION', `do not read')dnl define(`_PAGE', `software/')dnl define(`_STYLE', `')dnl +define(`_nothing', `')dnl include(`../html.m4')dnl include(`../head.m4')dnl
@@ -38,6 +39,71 @@ Plan 9 from Bell Labs, due to its historical relationship with UNIX, will be men+Don't use _code(`echo(1)'), use _code(`printf(1)'). +_code(`printf(1)') simulates the _code(`printf(3)') function in the C standard I/O library which has no significant variations, whereas the functionality of _code(`echo(1)') can vary between vendors. +
++_code(`printf "%s" "$*"') does not work as _code(`echo(1)') though it's been said to do so (including by this page). +
++The following is an implementation of _code(`echo(1)') in the C programming language, using the standard library. +
++#include <stdio.h> +int main(int argc, char *argv[]) { + int i; + for(i = 1; ; ) { + printf("%s", argv[i]); + ++i; + if(i == argc) { + putchar('\n'); + break; + } else + putchar(' '); + } + return 0; +} ++
+The following is an implementation of _code(`echo(1)') in shell. +
++while :; do + printf "%s" "$1" + `shift' + if test -z "$1"; then + printf "\n" + break + else + printf " " + fi +done ++ +
+A particularly shoddy attempt at _code(`ed(1)') is provided by _code(`busybox'). +A traditional _code(`ed(1)') implementation is in plan9ports. +I'm pretty sure some later UNIX-based OSes doubled the _code(`ed(1)') buffers, there's pretty much no downside to doing so in the modern era but it should be very easy to do yourself if it hasn't already been done (just double some of the array sizes in the beginning of _code(`ed.c')). +
+-Don't use _code(`echo(1)'), use _code(`printf(1)'). -_code(`printf(1)') simulates the _code(`printf(3)') function in the C standard I/O library which has no significant variations, whereas the functionality of _code(`echo(1)') can vary between vendors. -The following _code(`sh(1)') program provides _code(`echo(1)') through _code(`printf(1)'): +For linking to libraries, see _hyperlink(`#pkg-config', `pkg-config').
--#!/bin/sh -printf "%s" "$*" -- -
From the anals of my notes, 2021-06-04:
+From the annals of my notes, 2021-06-04:
Had an issue with pacman missing some ubiquitous packages (esr's `ascii`, xorg-xev, etc). This fixed it. I don't really know why - maybe some issues with my repos? @@ -498,10 +547,26 @@ NetBSD includes _code(`pcictl(8)') which offers similar functionality. _code(`pcictl pci0 list') outputs roughly the same information as _code(`lspci(8)'), though _code(`lspci(8)') may offer slightly more detailed information. +pkg-config
+
+pkg-config provides a way to link to libraries independent of a particular system's directory heirarchy. +
++The relevant manual pages on NetBSD are _code(`pkgconf(1)'), _code(`pc(5)'), and _code(`pkg.m4(7)'). +
+Try _code(`pkg_admin(1)').
-A particularly shoddy attempt at _code(`ed(1)') is provided by _code(`busybox'). -A traditional _code(`ed(1)') implementation is in plan9ports. -I'm pretty sure some later UNIX-based OSes doubled the _code(`ed(1)') buffers, there's pretty much no downside to doing so in the modern era but it should be very easy to do yourself if it hasn't already been done (just double some of the array sizes in the beginning of _code(`ed.c')). -
Unlike _code(`busybox')'s _code(`ed(1)') implementation, its _code(`vi(1)') is very useable.