Mirror of Suckless' sbase (git://git.suckless.org/sbase)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Michael Forney 9e985c2bb2
install: Unlink destination file on failure
3 years ago
libutf paste: Support -d '\0' 3 years ago
libutil libutil/recurse: Use a single path buffer, and directory fd 3 years ago
.gitignore Add implementation of dd(1) 3 years ago
LICENSE ed: Don't match against line 0 in search() 6 years ago
Makefile Add implementation of dd(1) 3 years ago
README Import mknod from ubase 3 years ago
TODO Add a bugs section to TODO 3 years ago
arg.h arg.h: fixed argv checks order 7 years ago
basename.1 Use ISO-date-format in manpages 8 years ago
basename.c basename: support -- 5 years ago
cal.1 Fix various lint warnings in manuals 3 years ago
cal.c cal: Centre month and year above calendar 4 years ago
cat.1 Fix various lint warnings in manuals 3 years ago
cat.c concat: Use plain read/write instead of buffered stdio 6 years ago
chgrp.1 Fix various lint warnings in manuals 3 years ago
chgrp.c libutil/recurse: Use a single path buffer, and directory fd 3 years ago
chmod.1 chmod: Remove -HLP flags, and ignore symlinks during traversal 3 years ago
chmod.c libutil/recurse: Use a single path buffer, and directory fd 3 years ago
chown.1 Fix various lint warnings in manuals 3 years ago
chown.c libutil/recurse: Use a single path buffer, and directory fd 3 years ago
chroot.1 Use ISO-date-format in manpages 8 years ago
chroot.c Revert "Do not use arg.h for tools which take no flags" 4 years ago
cksum.1 Use ISO-date-format in manpages 8 years ago
cksum.c Revert "Do not use arg.h for tools which take no flags" 4 years ago
cmp.1 Fix various lint warnings in manuals 3 years ago
cmp.c No need for semicolon after ARGEND 8 years ago
cols.1 Fix various lint warnings in manuals 3 years ago
cols.c Use the UTF8_POINT macro in cols(1) 7 years ago
comm.1 Use ISO-date-format in manpages 8 years ago
comm.c Rename struct linebufline to struct line and add linecmp() 7 years ago
compat.h Add compat.h 8 years ago
config.mk Use -D_FILE_OFFSET_BITS=64 by default 7 years ago
cp.1 Fix various lint warnings in manuals 3 years ago
cp.c cp: Default to -P when -R is specified 3 years ago
cron.1 Use ISO-date-format in manpages 8 years ago
cron.c Sync cron with latest scron 7 years ago
crypt.h Don't use buffered IO (fread) when not appropriate 6 years ago
cut.1 Fix various lint warnings in manuals 3 years ago
cut.c Support NUL containing lines in cut(1) 7 years ago
date.1 Fix various lint warnings in manuals 3 years ago
date.c date: Fix default format string 4 years ago
dd.1 Add implementation of dd(1) 3 years ago
dd.c Add implementation of dd(1) 3 years ago
dirname.1 Use ISO-date-format in manpages 8 years ago
dirname.c dirname: support -- 5 years ago
du.1 Fix various lint warnings in manuals 3 years ago
du.c libutil/recurse: Use a single path buffer, and directory fd 3 years ago
echo.1 Use ISO-date-format in manpages 8 years ago
echo.c Handle { NULL } argv[] properly in manual arg-reduction 6 years ago
ed.1 Fix various lint warnings in manuals 3 years ago
ed.c Add a bugs section to TODO 3 years ago
env.1 Use ISO-date-format in manpages 8 years ago
env.c env: Check unsetenv() return value 7 years ago
expand.1 Use ISO-date-format in manpages 8 years ago
expand.c No need for semicolon after ARGEND 8 years ago
expr.1 Fix various lint warnings in manuals 3 years ago
expr.c expr: Allocate arrays with reallocarray instead of VLA 4 years ago
false.1 Use ISO-date-format in manpages 8 years ago
false.c Simplify true(1) and false(1) 9 years ago
find.1 Fix various lint warnings in manuals 3 years ago
find.c find: Fix buffer overflow in token stack 3 years ago
flock.1 Fix various lint warnings in manuals 3 years ago
flock.c flock: Check for waitpid() error 7 years ago
fold.1 Fix various lint warnings in manuals 3 years ago
fold.c Support NUL containing lines in fold(1) and reuse the line-buffer(!) 7 years ago
fs.h libutil/recurse: Use a single path buffer, and directory fd 3 years ago
getconf.1 getconf: Report invalid variables as errors 6 years ago
getconf.c getconf: Add an explicit return at the end of main 3 years ago
getconf.sh getconf.sh: remove unnecessary use of cat(1) 3 years ago
grep.1 Fix various lint warnings in manuals 3 years ago
grep.c grep: Fix exit status on use of -l 4 years ago
head.1 Fix various lint warnings in manuals 3 years ago
head.c Support NUL containing lines in head(1) 7 years ago
hostname.1 Use ISO-date-format in manpages 8 years ago
hostname.c Revert "Do not use arg.h for tools which take no flags" 4 years ago
join.1 Fix various lint warnings in manuals 3 years ago
join.c Support NUL containing lines in join(1) 7 years ago
kill.1 Use ISO-date-format in manpages 8 years ago
kill.c Handle { NULL } argv[] properly in manual arg-reduction 6 years ago
link.1 Use ISO-date-format in manpages 8 years ago
link.c Revert "Do not use arg.h for tools which take no flags" 4 years ago
ln.1 Use ISO-date-format in manpages 8 years ago
ln.c ln: Only fail if same inode without -f flag 7 years ago
logger.1 Fix various lint warnings in manuals 3 years ago
logger.c No need for semicolon after ARGEND 8 years ago
logname.1 Use ISO-date-format in manpages 8 years ago
logname.c Handle { NULL } argv[] properly in manual arg-reduction 6 years ago
ls.1 Fix various lint warnings in manuals 3 years ago
ls.c ls, tar: Guard inclusion of sys/sysmacros.h by absence of `major` definition 4 years ago
md5.h Add crypt.[ch] and update md5sum and sha1sum 10 years ago
md5sum.1 Use ISO-date-format in manpages 8 years ago
md5sum.c *sum: Ignore -b and -t flags 3 years ago
mkdir.1 Fix various lint warnings in manuals 3 years ago
mkdir.c mkdir: Fix created directory permissions 6 years ago
mkfifo.1 Fix various lint warnings in manuals 3 years ago
mkfifo.c mkfifo: Simplify -m handling 4 years ago
mknod.1 mknod: Add support for making FIFOs 3 years ago
mknod.c mknod: Add support for making FIFOs 3 years ago
mktemp.1 Fix various lint warnings in manuals 3 years ago
mktemp.c No need for semicolon after ARGEND 8 years ago
mv.1 Use ISO-date-format in manpages 8 years ago
mv.c libutil/recurse: Use a single path buffer, and directory fd 3 years ago
nice.1 Use ISO-date-format in manpages 8 years ago
nice.c Check if PRIO_MIN and PRIO_MAX are defined 7 years ago
nl.1 nl.1: document pages 3 years ago
nl.c Support NUL containing lines in nl(1) and reuse the line-buffer(!) 7 years ago
nohup.1 Use ISO-date-format in manpages 8 years ago
nohup.c Revert "Do not use arg.h for tools which take no flags" 4 years ago
od.1 Fix various lint warnings in manuals 3 years ago
od.c od: For the 'c' type, format non-printable charecters as octal 5 years ago
paste.1 Use ISO-date-format in manpages 8 years ago
paste.c paste: Minor style tweaks 3 years ago
pathchk.1 Fix pathchk manpage regarding exit status 7 years ago
pathchk.c Remove unnecessary ';' after ARGEND 4 years ago
printenv.1 Fix various lint warnings in manuals 3 years ago
printenv.c Revert "Do not use arg.h for tools which take no flags" 4 years ago
printf.1 Change the note in printf.1 on octal escapes 7 years ago
printf.c printf: handle \0 in %b arguments 6 years ago
pwd.1 Fix various lint warnings in manuals 3 years ago
pwd.c No need for semicolon after ARGEND 8 years ago
queue.h Use queue.h in grep(1) 8 years ago
readlink.1 readlink: Remove broken support for -m and -e 7 years ago
readlink.c readlink: Remove broken support for -m and -e 7 years ago
renice.1 Use ISO-date-format in manpages 8 years ago
renice.c Cleanup usage() across sbase 7 years ago
rev.1 Fix various lint warnings in manuals 3 years ago
rev.c Add rev(1) 6 years ago
rm.1 Use ISO-date-format in manpages 8 years ago
rm.c libutil/recurse: Use a single path buffer, and directory fd 3 years ago
rmdir.1 Use ISO-date-format in manpages 8 years ago
rmdir.c No need for semicolon after ARGEND 8 years ago
sed.1 Fix various lint warnings in manuals 3 years ago
sed.c sed: Include filename in error message 3 years ago
seq.1 Fix various lint warnings in manuals 3 years ago
seq.c Cleanup usage() across sbase 7 years ago
setsid.1 Use ISO-date-format in manpages 8 years ago
setsid.c Revert "Do not use arg.h for tools which take no flags" 4 years ago
sha1.h Add crypt.[ch] and update md5sum and sha1sum 10 years ago
sha1sum.1 Use ISO-date-format in manpages 8 years ago
sha1sum.c *sum: Ignore -b and -t flags 3 years ago
sha224.h add sha224sum and sha384sum 7 years ago
sha224sum.1 add sha224sum and sha384sum 7 years ago
sha224sum.c *sum: Ignore -b and -t flags 3 years ago
sha256.h Add sha256sum(1) 10 years ago
sha256sum.1 Use ISO-date-format in manpages 8 years ago
sha256sum.c *sum: Ignore -b and -t flags 3 years ago
sha384.h add sha224sum and sha384sum 7 years ago
sha384sum.1 add sha224sum and sha384sum 7 years ago
sha384sum.c *sum: Ignore -b and -t flags 3 years ago
sha512-224.h add sha512-224sum (SHA512/224) and sha512-256sum (SHA512/256) 7 years ago
sha512-224sum.1 add sha512-224sum (SHA512/224) and sha512-256sum (SHA512/256) 7 years ago
sha512-224sum.c *sum: Ignore -b and -t flags 3 years ago
sha512-256.h add sha512-224sum (SHA512/224) and sha512-256sum (SHA512/256) 7 years ago
sha512-256sum.1 add sha512-224sum (SHA512/224) and sha512-256sum (SHA512/256) 7 years ago
sha512-256sum.c *sum: Ignore -b and -t flags 3 years ago
sha512.h Add sha512sum(1) 10 years ago
sha512sum.1 Use ISO-date-format in manpages 8 years ago
sha512sum.c *sum: Ignore -b and -t flags 3 years ago
sleep.1 Use ISO-date-format in manpages 8 years ago
sleep.c Revert "Do not use arg.h for tools which take no flags" 4 years ago
sort.1 Fix various lint warnings in manuals 3 years ago
sort.c sort: Don't do fallback top-level sort in check mode 3 years ago
split.1 Use ISO-date-format in manpages 8 years ago
split.c Fix type mismatch in split(1) 7 years ago
sponge.1 Use ISO-date-format in manpages 8 years ago
sponge.c Revert "Do not use arg.h for tools which take no flags" 4 years ago
strings.1 Fix various lint warnings in manuals 3 years ago
strings.c No need for semicolon after ARGEND 8 years ago
sync.1 Fix various lint warnings in manuals 3 years ago
sync.c Revert "Do not use arg.h for tools which take no flags" 4 years ago
tail.1 Fix various lint warnings in manuals 3 years ago
tail.c tail: Process bytes with -c option, and add -m option for runes 6 years ago
tar.1 Fix various lint warnings in manuals 3 years ago
tar.c libutil/recurse: Use a single path buffer, and directory fd 3 years ago
tee.1 Use ISO-date-format in manpages 8 years ago
tee.c Don't use buffered IO (fread) when not appropriate 6 years ago
test.1 Update test.1: 7 years ago
test.c Handle { NULL } argv[] properly in manual arg-reduction 6 years ago
text.h concat: Use plain read/write instead of buffered stdio 6 years ago
tftp.1 Fix various lint warnings in manuals 3 years ago
tftp.c Include sys/time.h for timeval structure 7 years ago
time.1 Use ISO-date-format in manpages 8 years ago
time.c Fix type mismatches 7 years ago
touch.1 Fix various lint warnings in manuals 3 years ago
touch.c touch: Avoid unnecessary call to stat 7 years ago
tr.1 tr.1: Make note of some changes in the utility 7 years ago
tr.c tr: Fix infinite loop 6 years ago
true.1 Use ISO-date-format in manpages 8 years ago
true.c Simplify true(1) and false(1) 9 years ago
tsort.1 Fix various lint warnings in manuals 3 years ago
tsort.c Remove unnecessary ';' after ARGEND 4 years ago
tty.1 Use ISO-date-format in manpages 8 years ago
tty.c Revert "Do not use arg.h for tools which take no flags" 4 years ago
uname.1 Fix various lint warnings in manuals 3 years ago
uname.c uname: check that no operands are specified 5 years ago
unexpand.1 Use ISO-date-format in manpages 8 years ago
unexpand.c No need for semicolon after ARGEND 8 years ago
uniq.1 Fix various lint warnings in manuals 3 years ago
uniq.c uniq: always store previous line length 7 years ago
unlink.1 Use ISO-date-format in manpages 8 years ago
unlink.c Revert "Do not use arg.h for tools which take no flags" 4 years ago
utf.h paste: Support -d '\0' 3 years ago
util.h libutil: Rename functions in reserved namespace to prevent potential conflict 4 years ago
uudecode.1 Fix various lint warnings in manuals 3 years ago
uudecode.c Revert "fix length after '\' getline string termination" 7 years ago
uuencode.1 Use ISO-date-format in manpages 8 years ago
uuencode.c uuencode: style: just use pointer *b 7 years ago
wc.1 Use ISO-date-format in manpages 8 years ago
wc.c wc: Removing output padding 3 years ago
which.1 Use ISO-date-format in manpages 8 years ago
which.c which: check AT_EACCESS 4 years ago
whoami.1 Add whoami(1) 7 years ago
whoami.c Handle { NULL } argv[] properly in manual arg-reduction 6 years ago
xargs.1 Fix various lint warnings in manuals 3 years ago
xargs.c Cleanup usage() across sbase 7 years ago
xinstall.1 Fix various lint warnings in manuals 3 years ago
xinstall.c install: Unlink destination file on failure 3 years ago
yes.1 yes: Simplify, only support one argument 3 years ago
yes.c yes: Simplify, only support one argument 3 years ago

README

sbase - suckless unix tools

===========================

sbase is a collection of unix tools that are inherently portable across
UNIX and UNIX-like systems.

The complement of sbase is ubase[1] which is Linux-specific and provides
all the non-portable tools. Together they are intended to form a base
system similar to busybox but much smaller and suckless.

Building
--------

To build sbase, simply type make. You may have to fiddle with config.mk
depending on your system.

You can also build sbase-box, which generates a single binary containing
all the required tools. You can then symlink the individual tools to
sbase-box or run: make sbase-box-install

Ideally you will want to statically link sbase. If you are on Linux we
recommend using musl-libc[2].

Portability
-----------

sbase has been compiled on a variety of different operating systems,
including Linux, *BSD, OSX, Haiku, Solaris, SCO OpenServer and others.

Various combinations of operating systems and architectures have also
been built.

You can build sbase with gcc, clang, tcc, nwcc and pcc.

Status
------

The following tools are implemented:

'#' -> UTF-8 support, '=' -> Implicit UTF-8 support, '*' -> Finished,
'|' -> Audited, 'o' -> POSIX 2013 compliant, 'x' -> Non-POSIX,
'0' -> NUL handling, '()' -> Petty flag

UTILITY MISSING
------- -------
0=*|o basename .
0=*|o cal .
0=*|o cat .
0=*|o chgrp .
0=*|o chmod .
0=*|o chown .
0=*|x chroot .
0=*|o cksum .
0=*|o cmp .
0#*|x cols .
0=*|o comm .
0=*|o cp (-i)
0=*|x cron .
0#*|o cut .
0=*|o date .
0=*|o dirname .
0=*|o du .
0=*|o echo .
o ed .
0=*|o env .
0#*|o expand .
0#*|o expr .
0=*|o false .
0= find .
0=* x flock .
0#*|o fold .
0=*|o getconf (-v)
=*|o grep .
0=*|o head .
0=*|x hostname .
0=*|x install .
0=* o join .
0=*|o kill .
0=*|o link .
0=*|o ln .
0=*|o logger .
0=*|o logname .
0#* o ls (-C, -k, -m, -p, -s, -x)
0=*|x md5sum .
0=*|o mkdir .
0=*|o mkfifo .
0=*|x mknod .
0=*|x mktemp .
0=*|o mv (-i)
0=*|o nice .
0#*|o nl .
0=*|o nohup .
0=*|o od .
0#* o pathchk .
#*|o paste .
0=*|x printenv .
0#*|o printf .
0=*|o pwd .
0=*|x readlink .
0=*|o renice .
0#* x rev .
0=*|o rm (-i)
0=*|o rmdir .
# sed .
0=*|x seq .
0=*|x setsid .
0=*|x sha1sum .
0=* x sha224sum .
0=*|x sha256sum .
0=* x sha238sum .
0=*|x sha512sum .
0=* x sha512-224sum .
0=* x sha512-256sum .
0=*|o sleep .
0#*|o sort .
0=*|o split .
0=*|x sponge .
0#*|o strings .
0=*|x sync .
0=*|o tail .
0=*|x tar .
0=*|o tee .
0=*|o test .
0=*|x tftp .
0=*|o time .
0=*|o touch .
0#*|o tr .
0=*|o true .
0=* o tsort .
0=*|o tty .
0=*|o uname .
0#*|o unexpand .
0=*|o uniq .
0=*|o unlink .
0=*|o uudecode .
0=*|o uuencode .
0#*|o wc .
0=*|x which .
0=*|x whoami .
0=*|o xargs (-p)
0=*|x yes .

[1] http://git.suckless.org/ubase/
[2] http://www.musl-libc.org/