Ivan Shmakov <oneing...@gmail.com> writes:

>       ?  How is the ‘if’ statement above different to, say:

> case "$1" in
>     (remove)
>         update-alternatives --remove <foo> <path-to-foo>
>         ;;
> esac

It's not; what it *is* different from is the more common case
construction, which instead looks like:

case "$1" in
    (remove)
        update-alternatives --remove <foo> <path-to-foo>
        ;;
    (upgrade|failed-upgrade|deconfigure)
        ;;
    (*)
        echo "Unknown call $@" >&2
        exit 1
        ;;
esac

If the case doesn't have that default case, it doesn't have this problem,
but when you see the case statement, you usually see that form.

-- 
Russ Allbery (r...@debian.org)               <http://www.eyrie.org/~eagle/>


--
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/877gr1a84e....@windlord.stanford.edu

Reply via email to