Thesaurus in the command line

#!/usr/bin/env bash

# Install an English command-line thesaurus.

install_thesaurus() {
    defaulturl=http://download.huzheng.org/bigdict/stardict-Macmillan_English_Thesaurus-2.4.2.tar.bz2

    dict=${1:-defaulturl}

    wget -c "$dict" -O dict.tar.bz2

    sudo mkdir -p /usr/share/stardict/dic

    sudo tar -xvjf dict.tar.bz2 -C /usr/share/stardict/dic
}

demo() {
    sdcv -u "Macmillan English Thesaurus (En-En)" best
}

install_thesaurus "http://download.huzheng.org/bigdict/stardict-Macmillan_English_Thesaurus-2.4.2.tar.bz2"

demo