Script to unpack archives of various kinds
I'm not sure why we have #!/bin/bash - it looks like plain, portable #!/bin/sh would be fine here.
Things I immediately like include the good error handling, using &amp;2 for error messages and exiting non-zero.
All the tar commands can be combined, as tar is able (with -a) to automatically identify any compression scheme it handles.
As there's no need to continue once the archiver is run, we can replace the shell process using exec.  E.g.
case $1 in
    *.7z) exec 7z e &quot;$1&quot;
        ;;

Don't do that if we extend the program to process multiple input files, though (see below).
If we take the usual convention of flags first, then it makes it easier when we decide we want to handle more options (e.g. -v, so we can default to quiet operation).  And we can combine the two big case constructs by always passing a directory, but defaulting to the current working directory:
destination=.

die() {
    printf '%s\n' &quot;$@&quot; &gt;&amp;2
    exit 1
}

do_extract() {
    case $1 in
        *.tar.*|*.t[bg]z) tar xaf &quot;$1&quot; -C &quot;$destination&quot;
            ;;
        *.jar|*.zip) unzip &quot;$1&quot; -d &quot;$destination&quot;
            ;;
        # ...
    esac
}

while [ $# -ge 1 ]
do
    case &quot;$1&quot; in
        -d)
            [ $# -gt 1 ] || die &quot;Usage: $0 [-d directory] file...&quot;
            destination=$2
            shift 2
            ;;
        -*)
            die &quot;Unrecognised option: $1&quot;
        *)
            do_extract &quot;$1&quot;
            shift
    esac
done

Be careful with echo:

usage() {
    echo &quot;Usage: nzip [FILE]...&quot;
    echo &quot;By default file(s) will be extracted to the working directory.&quot;
    echo
    echo &quot;OPTIONS..&quot;
    echo
    echo &quot;-d, --directory, eg. nzip [file] [-d] [directory]&quot;
    echo
    echo
}


Other (e.g. future) versions of echo may treat that -d as indicating a flag.
I'd be inclined to use a here-file for this:
usage() {
    cat &lt;&lt;'END'
Usage: nzip [FILE] [-d DESTINATION]
By default file(s) will be extracted to the working directory.

OPTIONS:
    -d destination
END
}

Note that I've changed the usage line, because we support only one file, and -d and the destination argument go together (and it's misleading to call it &quot;directory&quot; when it may be a non-directory name if we're unpacking a single file).