1
0
This commit is contained in:
dtb 2022-10-17 17:48:30 -04:00
parent 7dbbe158af
commit 9523e77e7c

View File

@ -4,6 +4,7 @@ define(`_TITLE', `guide to software')dnl
define(`_DESCRIPTION', `do not read')dnl define(`_DESCRIPTION', `do not read')dnl
define(`_PAGE', `software/')dnl define(`_PAGE', `software/')dnl
define(`_STYLE', `')dnl define(`_STYLE', `')dnl
define(`_nothing', `')dnl
include(`../html.m4')dnl include(`../html.m4')dnl
include(`../head.m4')dnl include(`../head.m4')dnl
<BODY> <BODY>
@ -38,6 +39,71 @@ Plan 9 from Bell Labs, due to its historical relationship with UNIX, will be men
<LI>_hyperlink(`https://github.com/dspinellis/unix-history-repo', `unix-history-repo') (GitHub)</LI> <LI>_hyperlink(`https://github.com/dspinellis/unix-history-repo', `unix-history-repo') (GitHub)</LI>
</UL> </UL>
<H2>POSIX</H2>
<H3 ID="echo">echo(1)</H3>
<UL>
<LI>_hyperlink(`https://en.wikipedia.org/wiki/Echo_(command)', `echo') (Wikipedia)</LI>
<LI>_hyperlink(`https://man7.org/linux/man-pages/man1/echo.1p.html', `echo(1p)') (man7)</LI>
<LI><A HREF="https://www.in-ulm.de/~mascheck/various/echo+printf/">Variations in echo implementations</A></LI>
</UL>
<P>
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.
</P>
<P>
_code(`printf "%s" "$*"') does not work as _code(`echo(1)') though it's been said to do so (including by this page).
</P>
<P>
The following is an implementation of _code(`echo(1)') in the C programming language, using the standard library.
</P>
<PRE>
#include &lt;stdio.h&gt;
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;
}
</PRE>
<P>
The following is an implementation of _code(`echo(1)') in shell.
</P>
<PRE>
while :; do
printf "%s" "$1"
`shift'
if test -z "$1"; then
printf "\n"
break
else
printf " "
fi
done
</PRE>
<H3 ID="find">find(1)</H3>
<UL>
<LI><A HREF="https://en.wikipedia.org/wiki/Find_(Unix)">find</A> (Wikipedia)</LI>
</UL>
<H3 ID="ed">ed(1)</H3>
<UL>
<LI><A HREF="https://catonmat.net/ftp/ed.text.editor.cheat.sheet.txt">Ed Cheat Sheet</A></LI>
</UL>
<P>
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')).
</P>
<H2>Advanced Configuration and Power Interface</H2> <H2>Advanced Configuration and Power Interface</H2>
<UL> <UL>
<LI><A HREF="https://en.wikipedia.org/wiki/Advanced_Configuration_and_Power_Interface">Advanced Configuration and Power Interface</A> (Wikipedia)</LI> <LI><A HREF="https://en.wikipedia.org/wiki/Advanced_Configuration_and_Power_Interface">Advanced Configuration and Power Interface</A> (Wikipedia)</LI>
@ -70,26 +136,9 @@ In most system package managers, standard library documentation can be found in
Many Linux software distributions' system package managers have meta-packages that pull all necessities for C development as dependencies. Many Linux software distributions' system package managers have meta-packages that pull all necessities for C development as dependencies.
Alpine has _code(`build-base') and Debian has _code(`build-essential'). Alpine has _code(`build-base') and Debian has _code(`build-essential').
</P> </P>
<H2>echo(1)</H2>
<UL>
<LI><A HREF="https://www.in-ulm.de/~mascheck/various/echo+printf/">Variations in echo implementations</A></LI>
</UL>
<P> <P>
Don't use _code(`echo(1)'), use _code(`printf(1)'). For linking to libraries, see _hyperlink(`#pkg-config', `pkg-config').
_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)'):
</P> </P>
<PRE>
#!/bin/sh
printf "%s" "$*"
</PRE>
<H2 ID="find">find(1)</H2>
<UL>
<LI><A HREF="https://en.wikipedia.org/wiki/Find_(Unix)">find</A> (Wikipedia</LI>
</UL>
<H2 ID="fonts">Fonts</H2> <H2 ID="fonts">Fonts</H2>
@ -193,7 +242,7 @@ Text editors, network managers or utilities, and other administration tools, for
Manual utilities such as _code(`man-db') and others would also be useful. Manual utilities such as _code(`man-db') and others would also be useful.
</P> </P>
<H5>Ubiquitous packages missing</H5> <H5>Ubiquitous packages missing</H5>
<P>From the anals of my notes, 2021-06-04:</P> <P>From the annals of my notes, 2021-06-04:</P>
<PRE> <PRE>
Had an issue with pacman missing some ubiquitous packages (esr's `ascii`, xorg-xev, etc). 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? 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. _code(`pcictl pci0 list') outputs roughly the same information as _code(`lspci(8)'), though _code(`lspci(8)') may offer slightly more detailed information.
</P> </P>
<H2 ID="pkg-config">pkg-config</H2>
<UL>
<LI>_hyperlink(`https://en.wikipedia.org/wiki/Pkg-config', `pkg-config') (Wikipedia)</LI>
</UL>
<P>
pkg-config provides a way to link to libraries independent of a particular system's directory heirarchy.
</P>
<P>
The relevant manual pages on NetBSD are _code(`pkgconf(1)'), _code(`pc(5)'), and _code(`pkg.m4(7)').
</P>
<H2 ID="pkgsrc">pkgsrc</H2> <H2 ID="pkgsrc">pkgsrc</H2>
<UL> <UL>
<LI><A HREF="http://www.netbsd.org/docs/pkgsrc/"</A>the pkgsrc user's guide</A></LI> <LI><A HREF="http://www.netbsd.org/docs/pkgsrc/"</A>the pkgsrc user's guide</A></LI>
</UL> </UL>
<H3>_code(`pkg_add: Conflicting PLIST')</H3>
<UL>
<LI>_hyperlink(`https://mail-index.netbsd.org/pkgsrc-users/2013/06/07/msg018151.html', `Re: conflicting PLIST during install') (pkgsrc-Users Mailing List)</LI>
</UL>
<P>Try _code(`pkg_admin(1)').</P>
<H3>Upgrading packages</H3> <H3>Upgrading packages</H3>
<UL> <UL>
<LI><A HREF="http://www.netbsd.org/docs/pkgsrc/using.html">Using pkgsrc</A> (the pkgsrc user's guide)</LI> <LI><A HREF="http://www.netbsd.org/docs/pkgsrc/using.html">Using pkgsrc</A> (the pkgsrc user's guide)</LI>
@ -542,15 +607,6 @@ This generates an <A HREF="https://en.wikipedia.org/wiki/EdDSA#Ed25519">Ed25519<
_code(`nano(1)') is a text editor that's usually recommended for beginners because its controls are more intuitive. _code(`nano(1)') is a text editor that's usually recommended for beginners because its controls are more intuitive.
_code(`ne(1)') is like _code(`nano(1)') but with different superpowers. Not yet in pkgsrc. _code(`ne(1)') is like _code(`nano(1)') but with different superpowers. Not yet in pkgsrc.
</P> </P>
<H3>ed</H3>
<UL>
<LI><A HREF="https://catonmat.net/ftp/ed.text.editor.cheat.sheet.txt">Ed Cheat Sheet</A></LI>
</UL>
<P>
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')).
</P>
<H3>vi</H3> <H3>vi</H3>
<P> <P>
Unlike _code(`busybox')'s _code(`ed(1)') implementation, its _code(`vi(1)') is very useable. Unlike _code(`busybox')'s _code(`ed(1)') implementation, its _code(`vi(1)') is very useable.