π buzzybox: Portable shell utilities
buzzybox
is a multicall binary like busybox
that brings a subset of shell
utilities to multiple platforms. It can be run as a standalone program
(buzzybox
) or imported as a library (lesiw.io/buzzybox/hive
).
Features
Installation
go install lesiw.io/buzzybox@latest
Usage
Subcommand
echo "hello embedded world" | buzzybox awk '{ print $1, $3 }'
Symlink
ln -s "$(which buzzybox)" awk
echo "hello embedded world" | ./awk '{ print $1, $3 }'
Library
package main
import (
"strings"
"lesiw.io/buzzybox/hive"
)
func main() {
cmd := hive.Command("awk", "{ print $1, $3 }")
cmd.Stdin = strings.NewReader("hello embedded world")
cmd.Run()
}
βΆοΈ Run this example on the Go Playground
Docker
echo "hello embedded world" | docker run -i lesiw/buzzybox awk '{ print $1, $3 }'
App criteria for inclusion
One of the following:
- The app is defined in the POSIX standard.
- The app isnβt in POSIX, but is found in multiple *nix environments, like
MacOS, busybox, and at least one major non-busybox Linux distribution. (
tar
is a good example of a non-POSIX utility that is near-ubiquitous.)
And all of the following:
- Orthogonal: the app
solves a problem that cannot reasonably be solved by using the existing apps
in combination.
Support matrix
App |
Linux |
Windows |
MacOS |
TinyGo |
arch |
β
|
β
|
β
|
β
|
awk |
β
|
β
|
β
|
β
|
base64 |
β
|
β
|
β
|
β
|
basename |
β
|
β
|
β
|
β
|
cat |
β
|
β
|
β
|
β
|
false |
β
|
β
|
β
|
β
|
true |
β
|
β
|
β
|
β
|