a collection of unix tools that are portable across unix-systems.
Michael Forney d098ac4abc od: For the 'c' type, format non-printable charecters as octal 3 months ago
libutf Add mkrunetype.awk 3 years ago
libutil libutil/recurse: only opendir if recursing 8 months ago
LICENSE ed: Don't match against line 0 in search() 1 year ago
Makefile Add missing getconf.h dependency to sbase-box 9 months ago
README Add rev(1) 1 year ago
TODO Add a TODO-note about crypt.c 1 year ago
arg.h arg.h: fixed argv checks order 2 years ago
basename.1 Use ISO-date-format in manpages 2 years ago
basename.c Handle { NULL } argv[] properly in manual arg-reduction 10 months ago
cal.1 Use ISO-date-format in manpages 2 years ago
cal.c cal: Highlight current day 2 years ago
cat.1 Use ISO-date-format in manpages 2 years ago
cat.c concat: Use plain read/write instead of buffered stdio 11 months ago
chgrp.1 Use ISO-date-format in manpages 2 years ago
chgrp.c Remove st != NULL checks from recursor functions 11 months ago
chmod.1 Use ISO-date-format in manpages 2 years ago
chmod.c chmod: Use DIRFIRST 8 months ago
chown.1 chown: fix user:group option parsing 2 years ago
chown.c Remove st != NULL checks from recursor functions 11 months ago
chroot.1 Use ISO-date-format in manpages 2 years ago
chroot.c Handle { NULL } argv[] properly in manual arg-reduction 10 months ago
cksum.1 Use ISO-date-format in manpages 2 years ago
cksum.c Handle { NULL } argv[] properly in manual arg-reduction 10 months ago
cmp.1 Use ISO-date-format in manpages 2 years ago
cmp.c No need for semicolon after ARGEND 2 years ago
cols.1 Use ISO-date-format in manpages 2 years ago
cols.c Use the UTF8_POINT macro in cols(1) 2 years ago
comm.1 Use ISO-date-format in manpages 2 years ago
comm.c Rename struct linebufline to struct line and add linecmp() 2 years ago
compat.h Add compat.h 3 years ago
config.mk Use -D_FILE_OFFSET_BITS=64 by default 2 years ago
cp.1 cp.1: source and dest are not optional 1 year ago
cp.c No need for semicolon after ARGEND 2 years ago
cron.1 Use ISO-date-format in manpages 2 years ago
cron.c Sync cron with latest scron 2 years ago
crypt.h Don't use buffered IO (fread) when not appropriate 11 months ago
cut.1 Use ISO-date-format in manpages 2 years ago
cut.c Support NUL containing lines in cut(1) 2 years ago
date.1 date: add date/time setting capability 9 months ago
date.c date: add date/time setting capability 9 months ago
dirname.1 Use ISO-date-format in manpages 2 years ago
dirname.c Handle { NULL } argv[] properly in manual arg-reduction 10 months ago
du.1 Use ISO-date-format in manpages 2 years ago
du.c du: Don't print 0 entry if stat of named file fails 11 months ago
echo.1 Use ISO-date-format in manpages 2 years ago
echo.c Handle { NULL } argv[] properly in manual arg-reduction 10 months ago
ed.1 ed: add manpage 1 year ago
ed.c ed: Write "?\n" and explanatory messages to stdout 3 months ago
env.1 Use ISO-date-format in manpages 2 years ago
env.c env: Check unsetenv() return value 2 years ago
expand.1 Use ISO-date-format in manpages 2 years ago
expand.c No need for semicolon after ARGEND 2 years ago
expr.1 Use ISO-date-format in manpages 2 years ago
expr.c Handle { NULL } argv[] properly in manual arg-reduction 10 months ago
false.1 Use ISO-date-format in manpages 2 years ago
false.c Simplify true(1) and false(1) 3 years ago
find.1 Use ISO-date-format in manpages 2 years ago
find.c find: remove VLAs 1 year ago
flock.1 Implement -o for flock(1) to close fd before exec 2 years ago
flock.c flock: Check for waitpid() error 2 years ago
fold.1 Use ISO-date-format in manpages 2 years ago
fold.c Support NUL containing lines in fold(1) and reuse the line-buffer(!) 2 years ago
fs.h Add SILENT flag to recurse() 3 years ago
getconf.1 getconf: Report invalid variables as errors 9 months ago
getconf.c getconf: Ensure output was written successfully 9 months ago
getconf.sh getconf.sh: Be more explicit we are using a heredoc here 1 year ago
grep.1 Use ISO-date-format in manpages 2 years ago
grep.c grep: Fix -v output and exit status 2 years ago
head.1 Use ISO-date-format in manpages 2 years ago
head.c Support NUL containing lines in head(1) 2 years ago
hostname.1 Use ISO-date-format in manpages 2 years ago
hostname.c Handle { NULL } argv[] properly in manual arg-reduction 10 months ago
join.1 Use ISO-date-format in manpages 2 years ago
join.c Support NUL containing lines in join(1) 2 years ago
kill.1 Use ISO-date-format in manpages 2 years ago
kill.c Handle { NULL } argv[] properly in manual arg-reduction 10 months ago
link.1 Use ISO-date-format in manpages 2 years ago
link.c Handle { NULL } argv[] properly in manual arg-reduction 10 months ago
ln.1 Use ISO-date-format in manpages 2 years ago
ln.c ln: Only fail if same inode without -f flag 1 year ago
logger.1 Use ISO-date-format in manpages 2 years ago
logger.c No need for semicolon after ARGEND 2 years ago
logname.1 Use ISO-date-format in manpages 2 years ago
logname.c Handle { NULL } argv[] properly in manual arg-reduction 10 months ago
ls.1 Use ISO-date-format in manpages 2 years ago
ls.c ls: abort a directory if we cannot opendir it 10 months ago
md5.h Add crypt.[ch] and update md5sum and sha1sum 4 years ago
md5sum.1 Use ISO-date-format in manpages 2 years ago
md5sum.c No need for semicolon after ARGEND 2 years ago
mkdir.1 Use ISO-date-format in manpages 2 years ago
mkdir.c mkdir: Fix created directory permissions 11 months ago
mkfifo.1 Use ISO-date-format in manpages 2 years ago
mkfifo.c No need for semicolon after ARGEND 2 years ago
mktemp.1 Use ISO-date-format in manpages 2 years ago
mktemp.c No need for semicolon after ARGEND 2 years ago
mv.1 Use ISO-date-format in manpages 2 years ago
mv.c mv: Ensure stat is initialized when we prune a tree 2 years ago
nice.1 Use ISO-date-format in manpages 2 years ago
nice.c Check if PRIO_MIN and PRIO_MAX are defined 2 years ago
nl.1 Use ISO-date-format in manpages 2 years ago
nl.c Support NUL containing lines in nl(1) and reuse the line-buffer(!) 2 years ago
nohup.1 Use ISO-date-format in manpages 2 years ago
nohup.c Handle { NULL } argv[] properly in manual arg-reduction 10 months ago
od.1 od: Add some missing type flags 1 year ago
od.c od: For the 'c' type, format non-printable charecters as octal 3 months ago
paste.1 Use ISO-date-format in manpages 2 years ago
paste.c Fix segmentation fault in paste(1) 9 months ago
pathchk.1 Fix pathchk manpage regarding exit status 2 years ago
pathchk.c pathchk: fixes and cleanup 1 year ago
printenv.1 printenv: exit status is 2 on failure 2 years ago
printenv.c Handle { NULL } argv[] properly in manual arg-reduction 10 months ago
printf.1 Change the note in printf.1 on octal escapes 2 years ago
printf.c printf: handle \0 in %b arguments 1 year ago
pwd.1 Use ISO-date-format in manpages 2 years ago
pwd.c No need for semicolon after ARGEND 2 years ago
queue.h Use queue.h in grep(1) 3 years ago
readlink.1 readlink: Remove broken support for -m and -e 2 years ago
readlink.c readlink: Remove broken support for -m and -e 2 years ago
renice.1 Use ISO-date-format in manpages 2 years ago
renice.c Cleanup usage() across sbase 2 years ago
rev.1 Add rev(1) 1 year ago
rev.c Add rev(1) 1 year ago
rm.1 Use ISO-date-format in manpages 2 years ago
rm.c No need for semicolon after ARGEND 2 years ago
rmdir.1 Use ISO-date-format in manpages 2 years ago
rmdir.c No need for semicolon after ARGEND 2 years ago
sed.1 Use ISO-date-format in manpages 2 years ago
sed.c sed: Fix parsing bug in find_delim 7 months ago
seq.1 Use ISO-date-format in manpages 2 years ago
seq.c Cleanup usage() across sbase 2 years ago
setsid.1 Use ISO-date-format in manpages 2 years ago
setsid.c Handle { NULL } argv[] properly in manual arg-reduction 10 months ago
sha1.h Add crypt.[ch] and update md5sum and sha1sum 4 years ago
sha1sum.1 Use ISO-date-format in manpages 2 years ago
sha1sum.c No need for semicolon after ARGEND 2 years ago
sha224.h add sha224sum and sha384sum 2 years ago
sha224sum.1 add sha224sum and sha384sum 2 years ago
sha224sum.c add sha224sum and sha384sum 2 years ago
sha256.h Add sha256sum(1) 4 years ago
sha256sum.1 Use ISO-date-format in manpages 2 years ago
sha256sum.c No need for semicolon after ARGEND 2 years ago
sha384.h add sha224sum and sha384sum 2 years ago
sha384sum.1 add sha224sum and sha384sum 2 years ago
sha384sum.c add sha224sum and sha384sum 2 years ago
sha512-224.h add sha512-224sum (SHA512/224) and sha512-256sum (SHA512/256) 2 years ago
sha512-224sum.1 add sha512-224sum (SHA512/224) and sha512-256sum (SHA512/256) 2 years ago
sha512-224sum.c add sha512-224sum (SHA512/224) and sha512-256sum (SHA512/256) 2 years ago
sha512-256.h add sha512-224sum (SHA512/224) and sha512-256sum (SHA512/256) 2 years ago
sha512-256sum.1 add sha512-224sum (SHA512/224) and sha512-256sum (SHA512/256) 2 years ago
sha512-256sum.c add sha512-224sum (SHA512/224) and sha512-256sum (SHA512/256) 2 years ago
sha512.h Add sha512sum(1) 4 years ago
sha512sum.1 Use ISO-date-format in manpages 2 years ago
sha512sum.c No need for semicolon after ARGEND 2 years ago
sleep.1 Use ISO-date-format in manpages 2 years ago
sleep.c Handle { NULL } argv[] properly in manual arg-reduction 10 months ago
sort.1 Forgot to bump date for sort(1) manpage 2 years ago
sort.c sort: Fix line comparison when col buffer contains data from longer line 1 year ago
split.1 Use ISO-date-format in manpages 2 years ago
split.c Fix type mismatch in split(1) 2 years ago
sponge.1 Use ISO-date-format in manpages 2 years ago
sponge.c Handle { NULL } argv[] properly in manual arg-reduction 10 months ago
strings.1 Use ISO-date-format in manpages 2 years ago
strings.c No need for semicolon after ARGEND 2 years ago
sync.1 Use ISO-date-format in manpages 2 years ago
sync.c Handle { NULL } argv[] properly in manual arg-reduction 10 months ago
tail.1 tail: Process bytes with -c option, and add -m option for runes 11 months ago
tail.c tail: Process bytes with -c option, and add -m option for runes 11 months ago
tar.1 tar: support -f - for stdin/out 2 years ago
tar.c tar: Fix a few weprintf/eprintf format strings 9 months ago
tee.1 Use ISO-date-format in manpages 2 years ago
tee.c Don't use buffered IO (fread) when not appropriate 11 months ago
test.1 Update test.1: 2 years ago
test.c Handle { NULL } argv[] properly in manual arg-reduction 10 months ago
text.h concat: Use plain read/write instead of buffered stdio 11 months ago
tftp.1 Use ISO-date-format in manpages 2 years ago
tftp.c Include sys/time.h for timeval structure 2 years ago
time.1 Use ISO-date-format in manpages 2 years ago
time.c Fix type mismatches 2 years ago
touch.1 Use ISO-date-format in manpages 2 years ago
touch.c touch: Avoid unnecessary call to stat 1 year ago
tr.1 tr.1: Make note of some changes in the utility 1 year ago
tr.c tr: Fix infinite loop 7 months ago
true.1 Use ISO-date-format in manpages 2 years ago
true.c Simplify true(1) and false(1) 3 years ago
tsort.1 tsort.1: use mandoc literal block for example 2 years ago
tsort.c tsort style fixes 2 years ago
tty.1 Use ISO-date-format in manpages 2 years ago
tty.c Handle { NULL } argv[] properly in manual arg-reduction 10 months ago
uname.1 Use ISO-date-format in manpages 2 years ago
uname.c No need for semicolon after ARGEND 2 years ago
unexpand.1 Use ISO-date-format in manpages 2 years ago
unexpand.c No need for semicolon after ARGEND 2 years ago
uniq.1 Use ISO-date-format in manpages 2 years ago
uniq.c uniq: always store previous line length 2 years ago
unlink.1 Use ISO-date-format in manpages 2 years ago
unlink.c Handle { NULL } argv[] properly in manual arg-reduction 10 months ago
utf.h Scrap chartorunearr(), introducing utftorunestr() 3 years ago
util.h concat: Use plain read/write instead of buffered stdio 11 months ago
uudecode.1 Use ISO-date-format in manpages 2 years ago
uudecode.c Revert "fix length after '\' getline string termination" 2 years ago
uuencode.1 Use ISO-date-format in manpages 2 years ago
uuencode.c uuencode: style: just use pointer *b 2 years ago
wc.1 Use ISO-date-format in manpages 2 years ago
wc.c Fix wc(1) output for large files 2 years ago
which.1 Use ISO-date-format in manpages 2 years ago
which.c which: Minor simplification 7 months ago
whoami.1 Add whoami(1) 2 years ago
whoami.c Handle { NULL } argv[] properly in manual arg-reduction 10 months ago
xargs.1 Use ISO-date-format in manpages 2 years ago
xargs.c Cleanup usage() across sbase 2 years ago
xinstall.1 install: ignore -s 1 year ago
xinstall.c concat: Use plain read/write instead of buffered stdio 11 months ago
yes.1 Use ISO-date-format in manpages 2 years ago
yes.c Handle { NULL } argv[] properly in manual arg-reduction 10 months ago

README

sbase - suckless unix tools
===========================

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

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 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 .

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.

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