Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Tue, 17 Oct 2000 18:03:27 -0400 From: Andy Philpotts X-Mailer: The Bat! (v1.46c) Reply-To: "andy.philpotts" Organization: Product Development X-Priority: 3 (Normal) Message-ID: <122102925068.20001017180327@calendarcentral.com> To: cygwin AT sourceware DOT cygnus DOT com Subject: getopts in functions Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Should getopts work correctly in functions? I find if I try that if I get an error processing the options, then retry the function, it seems to get confused. Do I have to do something explicit to reset getopts? My code looks like (... elides detail): function jc() { while getopts "d:c:h" OPT; do case $OPT in d ) ... ;; c ) ... ;; h ) echo $USAGE return 1 ;; \? ) echo "Error, unrecognized option" echo $USAGE return 1 ;; esac done ... } -- Best regards, Andy mailto:andy DOT philpotts AT calendarcentral DOT com -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com