Shell tools that suck less!
C Other Awk Other
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
libutf
libutil
libuutil
res
.gitignore
Android.mk
LICENSE
Makefile
README
README.md
TODO
arg.h
basename.1
basename.c
cal.1
cal.c
cat.1
cat.c
chgrp.1
chgrp.c
chmod.1
chmod.c
chown.1
chown.c
chroot.1
chroot.c
cksum.1
cksum.c
clear.c
cmp.1
cmp.c
col.1
col.c
cols.1
cols.c
comm.1
comm.c
compat.h
config.h
config.mk
cp.1
cp.c
cron.1
cron.c
crypt.h
cut.1
cut.c
date.1
date.c
dd.c
df.c
dirname.1
dirname.c
dmesg.c
du.1
du.c
echo.1
echo.c
env.1
env.c
expand.1
expand.c
expr.1
expr.c
false.1
false.c
find.1
find.c
fmemopen.h
fold.1
fold.c
free.c
fs.h
grep.1
grep.c
halt.c
head.1
head.c
hostname.1
hostname.c
hwclock.c
id.c
install_cmd.sh
kill.1
kill.c
last.c
lastlog.c
link.1
link.c
ln.1
ln.c
logger.1
logger.c
logname.1
logname.c
ls.1
ls.c
lsusb.c
md5.h
md5sum.1
md5sum.c
mkdir.1
mkdir.c
mkfifo.1
mkfifo.c
mknod.c
mkswap.c
mktemp.1
mktemp.c
mv.1
mv.c
nice.1
nice.c
nl.1
nl.c
nohup.1
nohup.c
pagesize.c
paste.1
paste.c
pidof.c
printenv.1
printenv.c
printf.1
printf.c
proc.h
ps.c
pwd.1
pwd.c
queue.h
readlink.1
readlink.c
reboot.h
regex.h
renice.1
renice.c
respawn.c
rm.1
rm.c
rmdir.1
rmdir.c
rtc.h
sed.1
sed.c
seq.1
seq.c
setsid.1
setsid.c
sha1.h
sha1sum.1
sha1sum.c
sha256.h
sha256sum.1
sha256sum.c
sha512.h
sha512sum.1
sha512sum.c
sleep.1
sleep.c
sort.1
sort.c
split.1
split.c
sponge.1
sponge.c
stat.c
strings.1
strings.c
swap.h
sync.1
sync.c
sysctl.c
tail.1
tail.c
tar.1
tar.c
tee.1
tee.c
test.1
test.c
text.h
time.1
time.c
touch.1
touch.c
tr.1
tr.c
true.1
true.c
truncate.c
tty.1
tty.c
uname.1
uname.c
unexpand.1
unexpand.c
uniq.1
uniq.c
unlink.1
unlink.c
utf.h
util.h
utmpx.h
uudecode.1
uudecode.c
uuencode.1
uuencode.c
watch.c
wc.1
wc.c
who.c
xargs.1
xargs.c
yes.1
yes.c

README.md

FOREWORD

Hi. First, I would like to direct you to the file called 'README' (without extension) -- it is the file where you will find information on the sbase ("suck less") project, written by the authors.

This file is only about the Android "port" (if it can be called that)

I created this project because:

  1. I am tired of some limitations of Busybox -- while an excellent project, due to its own lightweight nature, the lack of certain command line modifiers has been driving me up the wall. A good example is that when I am checking files on my phone, I would like, as in my other shells, to be able to type 'ls -ltr' to sort them most recent last. Alas, I cannot.

  2. While sbase is a well written project that compiles almost anywhere, Android was not put together with POSIX compatibility as its first and foremost goal. Thus, the "upstream" sbase repository does not build.

A LAUNDRY LIST

Note: this is now sbase + some interesting utils from ubase as well. ubase, by the same less sucky people!

Some of the things I have done to please the Android ndk:

  • Fixed some imports, such as termios.
  • Added some imports and code such as fmemopen
  • Stubbed out some missing functions such as linkat()
  • Added missing default functions such as stdtold()
  • Added missing POSIX definitions (now more than 1 :))
  • Created Android-specific Makefiles and Android.mk

I also borrowed some code from OpenBSD. Unlike Linux's GNU utils, there is no license incompatibility. It is:

  • regex.h
  • libutil/regex2.h
  • libutil/cclass.h
  • libutil/cname.h
  • libutil/engine.c
  • libutil/fmemopen.c|h
  • libutil/getline.c
  • libutil/regcomp.c
  • libutil/regerror.c
  • libutil/regexec.c
  • libutil/regfree.c
  • libutil/utils.c

LIMITATIONS

At this point, there are several:

  • The code could be cleaner, especially the way I mix BSD imports with the original code.
  • This only builds for ARM. This could be easily fixed by adding a few targets to the build files.
  • Others, than I cannot think of right now but I am sure they are there nontheless.

Command (current) limitations

  • lsusb could not be implemented because /sys/bus/usb/devices is empty
  • ps, who could not be implemented in their raw form as they rely on u/wtmp
  • same goes for last
  • hwclock needs to be rewritten
  • halt is only to be called if you wish to freeze your phone, e.g. to interrupt an otherwise dangerous operation (rm -rf?)

BUILDING

make && \
make package

INSTALLING

adb push sbase_bin.zip /sdcard && \
adb shell && \
su && \
. ./install_cmd.sh <command name> && \
s_<command name> --help && \
# this last line was for testing.

CONTACT

My favorite ways to be contacted are:

Cheers,

Chris F. Ravenscroft

"This sucks less!" from stocksnap.io