LinuxCommandLibrary

betty

Check code style against Betty standards

TLDR

Ask Betty something

$ betty [what time is it]
copy

Download a file
$ betty download [https://example.com/file.ext] to [path/to/output_file.ext]
copy

Compress a file or directory to one of the support archive formats
$ betty [zip] [path/to/file_or_directory]
copy

Extract an archive into the current directory
$ betty [unzip] [archive.tar.gz]
copy

Extract an archive into a specific directory
$ betty unarchive [archive.tar.gz] to [path/to/directory]
copy

Play Spotify
$ betty play [Spotify]
copy

Drive Betty to madness
$ betty go crazy
copy

Display version
$ betty version
copy

SYNOPSIS

betty [EXPRESSION]

PARAMETERS

--help
    Display brief usage help and exit

--version
    Output version information and exit

EXPRESSION
    Natural language math query (required unless reading from stdin)

DESCRIPTION

Betty is a lightweight, user-friendly calculator designed for the Linux terminal that interprets mathematical expressions written in plain English words. Instead of cryptic syntax, you can type queries like betty "two times three plus five" and get 11 as output. It supports numbers from zero to googol (written as words or digits), basic arithmetic operations (plus, minus, times, divided by, to the power of), parentheses for grouping, factorials (!), and trigonometric functions like sin, cos, tan, sqrt, log, and exp.

Betty shines in simplicity: invoke it with an expression as the argument, or pipe input via stdin for multi-line calculations. It's ideal for quick math without leaving the shell or learning tools like bc or dc. Results are output in decimal by default, with high precision internally. While not a full computer algebra system, it's perfect for everyday computations, unit conversions aren't supported, but word-based input reduces errors in fast typing.

Developed for Debian, it's available in repositories for Ubuntu and derivatives, making complex calc feel conversational.

CAVEATS

Limited to simple expressions; no variables, loops, or advanced algebra. Large numbers or deep nesting may overflow. English words only (no other languages). Precision loss possible in very large results.

EXAMPLE USAGE

betty "twenty three plus forty two"65
echo "sin(pi/2)" | betty1
betty "(5+3)! / 2^3"252

SUPPORTED OPERATIONS

Arithmetic: plus, minus, times, divided by, to the power of (^).
Functions: sqrt, sin, cos, tan, log, ln, exp, abs, factorial (!).
Constants: pi, e.

HISTORY

Created by László Boszormenyi (gcs@debian.org) around 2012 for Debian GNU/Linux. Maintained in Debian repos since version 0.1.1; focuses on minimalism and natural input parsing using custom tokenizer.

SEE ALSO

bc(1), dc(1), calc(1)

Copied to clipboard