forked from bonsai/harakit
Compare commits
6 Commits
sleep
...
f1f5ac1788
| Author | SHA1 | Date | |
|---|---|---|---|
| f1f5ac1788 | |||
| 7f59c3b617 | |||
| 9ef6289e00 | |||
|
9093b06166
|
|||
|
d8b54fdbf5
|
|||
|
f6aac60aee
|
5
Makefile
5
Makefile
@@ -17,6 +17,8 @@
|
||||
DESTDIR ?= dist
|
||||
PREFIX ?= /usr/local
|
||||
|
||||
MANDIR != [ $(PREFIX) = / ] && printf '/usr/share/man\n' \
|
||||
|| printf '/share/man\n'
|
||||
SYSEXITS != printf '\043include <sysexits.h>\n' | cpp -M - | sed 's/ /\n/g' \
|
||||
| sed -n 's/sysexits\.h//p' || printf 'include\n'
|
||||
|
||||
@@ -42,7 +44,7 @@ clean:
|
||||
dist: all
|
||||
mkdir -p $(DESTDIR)/$(PREFIX)/bin $(DESTDIR)/$(PREFIX)/share/man/man1
|
||||
cp build/bin/* $(DESTDIR)/$(PREFIX)/bin
|
||||
cp docs/*.1 $(DESTDIR)/$(PREFIX)/share/man/man1
|
||||
cp docs/*.1 $(DESTDIR)/$(PREFIX)/$(MANDIR)/man1
|
||||
|
||||
.PHONY: install
|
||||
install: dist
|
||||
@@ -102,7 +104,6 @@ mm: build/bin/mm
|
||||
build/bin/mm: src/mm.c build
|
||||
$(CC) $(CFLAGS) -o $@ src/mm.c
|
||||
|
||||
|
||||
.PHONY: npc
|
||||
npc: build/bin/npc
|
||||
build/bin/npc: src/npc.c build
|
||||
|
||||
57
README
57
README
@@ -1,27 +1,27 @@
|
||||
“Seek not to walk the path of the masters; seek what they sought.”
|
||||
– Matsuo Basho
|
||||
For the Bonsai coreutils, a better Unix toolset, please visit
|
||||
<https://git.tebibyte.media/bonsai/coreutils>.
|
||||
|
||||
The Bonsai core utilities are the result of the careful examination of the
|
||||
current state of POSIX and Unix utilies. The Unix Philosophy, “do one thing and
|
||||
do it well” is its core but these tools do not cling to the names of the past.
|
||||
wwwww /
|
||||
wWWWWWw /_ _____ _ * "It's not a very good tree, but
|
||||
w|||w / \/ \ / | /\ / /|/ occasionally it bears fruit!"
|
||||
_,|||._ _/\__/|__// /_/_|_/_//|__
|
||||
bonsix : "BOHN zix" : "Bonsai" but "POSIX"
|
||||
|
||||
The era of the original Unix tools has been long and fruitful, but they have
|
||||
their flaws. The new, non-POSIX era of this project started with frustration
|
||||
with the way certain tools work and how other projects that extend POSIX don’t
|
||||
make anything better.
|
||||
The excellent Bonsai core utilities are the result of the careful examination
|
||||
of the current state of POSIX and Unix utilities, ironing out wrinkles in the
|
||||
implementations that ended up being worn by the POSIX standard. Bonsai's
|
||||
guiding quote is this one from Matsuo Basho:
|
||||
|
||||
This project will not follow in the footsteps of GNU; extensions of POSIX will
|
||||
not be found here. GNU extensions are a gateway to the misuse of the shell. The
|
||||
Bonsai core utilities will intentionally discourage use of the shell for
|
||||
purposes beyond its scope.
|
||||
"Seek not to walk the path of the masters; seek what they sought."
|
||||
|
||||
See docs/ for more on the specific utilities currently implemented.
|
||||
Unlike Bonsai, Bonsix intends to walk the path of the masters, implementing a
|
||||
POSIX userland under an AGPLv3 license and taking inspiration from the
|
||||
practices used by Bonsai.
|
||||
|
||||
Building
|
||||
|
||||
The coreutils require a POSIX-compliant environment to compile, including a C
|
||||
compiler and preprocessor (cc(1) and cpp(1) by default) with the -idirafter
|
||||
flag, a Rust compiler (rustc(1) by default), bindgen(1), and a POSIX-compliant
|
||||
Bonsix requires an existing POSIX-compliant environment to compile, including a
|
||||
C compiler and preprocessor (cc(1) and cpp(1) by default) and a POSIX-compliant
|
||||
make(1) utility.
|
||||
|
||||
To build and install:
|
||||
@@ -32,29 +32,6 @@ $ make PREFIX="/your/preferred/location" install
|
||||
To build with a different compiler than the default:
|
||||
|
||||
$ make CC=clang
|
||||
$ make RUSTC=gccrs
|
||||
|
||||
To test the utilities:
|
||||
|
||||
$ make test
|
||||
|
||||
To remove all untracked files:
|
||||
|
||||
$ make clean
|
||||
|
||||
Read More
|
||||
|
||||
An Introduction to the Unix Shell
|
||||
<https://porkmail.org/era/unix/shell>
|
||||
|
||||
Master Foo and the Ten Thousand Lines
|
||||
<http://www.catb.org/~esr/writings/unix-koans/ten-thousand.html>
|
||||
|
||||
Master Foo Discourses on the Unix-Nature
|
||||
<http://www.catb.org/~esr/writings/unix-koans/unix-nature.html>
|
||||
|
||||
Shell Programming!
|
||||
<https://tldp.org/LDP/abs/html/why-shell.html>
|
||||
|
||||
--
|
||||
Copyright © 2023–2024 Emma Tebibyte <emma@tebibyte.media>
|
||||
|
||||
53
docs/sleep.1
53
docs/sleep.1
@@ -1,53 +0,0 @@
|
||||
.\" Copyright (c) 2024 DTB <trinity@trinity.moe>
|
||||
.\"
|
||||
.\" This work is licensed under CC BY-SA 4.0. To see a copy of this license,
|
||||
.\" visit <http://creativecommons.org/licenses/by-sa/4.0/>.
|
||||
|
||||
.TH SLEEP 1
|
||||
|
||||
.SH NAME
|
||||
|
||||
sleep \(en wait a moment
|
||||
|
||||
.SH SYNOPSIS
|
||||
|
||||
sleep
|
||||
.RB [ seconds ]
|
||||
|
||||
.SH DESCRIPTION
|
||||
|
||||
Sleep waits the given amount of seconds before exiting.
|
||||
|
||||
.SH DIAGNOSTICS
|
||||
|
||||
Sleep exits successfully when the time specified has elapsed, or unsuccessfully
|
||||
if the time fails to elapse or if invoked incorrectly. In the latter scenario
|
||||
sleep will also print a usage synopsis.
|
||||
|
||||
.SH BUGS
|
||||
|
||||
User may still be tired after invoking sleep.
|
||||
|
||||
.SH EXAMPLES
|
||||
|
||||
The following invocation sleeps for five seconds.
|
||||
|
||||
.RS
|
||||
.R sleep 5
|
||||
.RE
|
||||
|
||||
The following sh(1p) command line sleeps for five minutes, or for sixty
|
||||
seconds, five times, using rpn(1) and xargs(1p).
|
||||
|
||||
.RS
|
||||
.R $ rpn 60 5 '*' | xargs sleep
|
||||
.RE
|
||||
|
||||
.SH COPYRIGHT
|
||||
|
||||
Copyright (c) 2024 DTB. License AGPLv3+: GNU AGPL version 3 or later
|
||||
<https://gnu.org/licenses/gpl.html>.
|
||||
|
||||
.SH SEE ALSO
|
||||
|
||||
sleep(3)
|
||||
Reference in New Issue
Block a user