From 9523e77e7c37ad20af40c81d1709f8ff45bffb6f Mon Sep 17 00:00:00 2001
From: dtb
+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.
+
+The following is an implementation of _code(`echo(1)') in shell.
+
+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')).
+POSIX
+
+echo(1)
+
+
+
+#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;
+}
+
+
+while :; do
+ printf "%s" "$1"
+ `shift'
+ if test -z "$1"; then
+ printf "\n"
+ break
+ else
+ printf " "
+ fi
+done
+
+
+find(1)
+
+
+
+ed(1)
+
+Advanced Configuration and Power Interface
-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.