Crush

Crush is an attempt to make a traditional command line shell that is also a modern programming language. It has the features one would expect from a modern programming language like a type system, closures and lexical scoping, but with a syntax geared toward both batch and interactive shell usage.

Building and installing Crush

OS X dependencies

Ubuntu dependencies

Install Rust

Install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

The installer adds ~/.cargo/bin to your path in new shells. To use it in the shell you installed it from, run

. "$HOME/.cargo/env"

Compile and install crush

clone this repository,

git clone https://github.com/liljencrantz/crush.git

and run

cd crush && cargo install --path .

and you should have a working binary to try out in ~/.cargo/bin. That directory should already be in your path, so just write crush to run the shell.

Overriding the system config directory

Crush looks for a system-wide config file (config.crush) and a system-wide modules directory (see docs/config.md) under /etc by default. A packager building for a different prefix can override this at build time by setting the CRUSH_SYSCONFDIR environment variable, the same way ./configure --sysconfdir=... would for an autoconf-based project:

CRUSH_SYSCONFDIR=/usr/local/etc cargo install --path .

This is baked into the resulting binary at compile time, not read from the environment at runtime -- rebuilding (even just touch build.rs && cargo build) is required to pick up a changed value.

Have fun!