From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <36B6BCDD.6834B3C6@uni-hamburg.de> Date: Tue, 02 Feb 1999 09:52:45 +0100 From: Bernd Eggink MIME-Version: 1.0 To: zsh-users@math.gatech.edu Subject: Re: OPTARG not being set? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailing-List: 2064 Sweth Chandramouli wrote: ... > this is the start of the function: > > unset USER_SPECIFIED_PATH; > while getopts ":p" CMD_LINE_OPT ; do > case ${CMD_LINE_OPT} in > p ) USER_SPECIFIED_PATH=${OPTARG};; > \? ) print "unknown option \"-${OPTARG}\"" > print 'usage: ' > print 'addpath [-p PSEUDO_ARRAY] first_item:second_item:...:nth_item' > return 1 > esac; > done; > > after this loop finishes, however, USER_SPECIFIED_PATH is still > null. i've put some echo statements in the case clause for option p, > which confirm that OPTARG is never being set, even though CMD_LINE_OPT > is matching 'p'. does anyone have any idea why? Options with arguments are denoted as "p:". ":p" has a different meaning; see "man zshbuiltins". Regards, Bernd -- Bernd Eggink Regionales Rechenzentrum der Uni Hamburg eggink@uni-hamburg.de http://www.rrz.uni-hamburg.de/eggink/BEggink.html