From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Davidson To: cygwin@sourceware.cygnus.com Subject: Re: B20.1: bash getopts? Date: Tue, 31 Aug 1999 23:49:00 -0000 Message-ID: <37A632C5.DC995268@werple.net.au> References: X-SW-Source: 1999-08n/msg00039.html Message-ID: <19990831234900.Tsvi8M-JNdl_hs-wisgi8597_WWoSNOhPwLON1J_aqg@z> Hi, You forgot the "!" in the first line of the script: #!/bin/bash Tim Robert Story wrote: > > Environment: Cygwin 20.1 beta, WinNT 4.0 build 1381 sp 4 > > I'm trying to run a bash script which uses getopts under cygwin. The > script works on my linux box, but reports 'getopts not found' under > cygwin. The bash help list getopts as a valid built-in command. The > script in question can be reduced to : > > #/bin/bash > # > while getopts ab flag > do > case "$flag" in > a) echo "Flag a";; > b) echo "Flag b";; > ?) echo "Flag unknown";; > esac > done > > I could not find any scripts in the bin directory that use getopts. > Should it work? Or is the help incorrect? > > -- > Want to unsubscribe from this list? > Send a message to cygwin-unsubscribe@sourceware.cygnus.com -- Tim Davidson timd@werple.net.au -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe@sourceware.cygnus.com