Home

Awesome

is.sh

Fancy alternative for old good test command.

NPM Version Build

Example

var=123

if is equal $var 123.0; then
    echo "it just works"
fi

if is not a substring $var "foobar"; then
    echo "and it's easy to read"
fi

Installation

In order to use is.sh you can install it with one of following 1-liners:

# Unix-like
$ sudo sh -c 'cd /usr/local/bin && wget raw.githubusercontent.com/qzb/is.sh/latest/is.sh -O is && chmod +x is'

# NPM
$ npm install -g is.sh

If you don't want to install is.sh system-wide you can just download it and source it from your script:

$ wget raw.githubusercontent.com/qzb/is.sh/latest/is.sh
$ source ./is.sh

Usage

Conditions

Negations

You can negate any condition by putting not in front of it.

$ is number "abc" && echo "number"
$ is not number "abc" && echo "not a number"
not a number

Articles

You can add a, an, and the articles before condition name.

$ is a number 5
$ is not a substring abc defghi

License

MIT