Re: zsh Kommandozeilenoptionen parsen

From: Oliver Fromme <olli(at)secnetix.de>
Date: Mon, 11 Feb 2002 13:44:51 +0100 (CET)

Matthias Teege <matthias(at)mteege.de> wrote:
> while getopts "d:c:f" OPT $DEFAULT_OPTIONS $*; do
> case $OPT in
> d) echo "Option d";;
> c) echo "Option c";;
> f) echo "Option f";;
> esac
> done
>
> Wie verabeite ich aber weitere Werte wie "-f dateiname".

Die stehen in $OPTARG (siehe die zshbuiltins(1) manpage).
Zum Beispiel:

case $OPT in
    f)
        echo "Option f mit Argument $OPTARG"
        ;;
esac

Gruß
   Olli

-- 
Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.
"All that we see or seem is just a dream within a dream" (E. A. Poe)
To Unsubscribe: send mail to majordomo(at)de.FreeBSD.org
with "unsubscribe de-bsd-questions" in the body of the message
Received on Mon 11 Feb 2002 - 13:44:55 CET

search this site