Re: Possible bug in getopts when required argument is not supplied

2015-11-13 Thread Griff Miller II
On Fri, November 13, 2015 12:56 pm, Greg Wooledge wrote: > On Fri, Nov 13, 2015 at 10:13:15AM -0600, Griff Miller II wrote: > >> % ./myscript -a -b b >> >> >> Note that in the last run, getopts does not detect that nothing was >> passed via -a, even though -a requires it. Instead, it thinks the

Re: Possible bug in getopts when required argument is not supplied

2015-11-13 Thread Greg Wooledge
On Fri, Nov 13, 2015 at 10:13:15AM -0600, Griff Miller II wrote: > % ./myscript -a -b b > > Note that in the last run, getopts does not detect that nothing was passed > via -a, even though -a requires it. Instead, it thinks the next switch > (-b) is the value of -a. Perhaps this was a conscious

Possible bug in getopts when required argument is not supplied

2015-11-13 Thread Griff Miller II
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: cygwin Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash.exe' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='cygwin' -DCONF_MACHTYPE='x86_64-unknown-cygwin' -DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/share/locale'

Re: Possible bug in getopts when required argument is not supplied

2015-11-13 Thread Dennis Williamson
On Fri, Nov 13, 2015 at 10:13 AM, Griff Miller II wrote: > Configuration Information [Automatically generated, do not change]: > Machine: x86_64 > OS: cygwin > Compiler: gcc > Compilation CFLAGS: -DPROGRAM='bash.exe' -DCONF_HOSTTYPE='x86_64' > -DCONF_OSTYPE='cygwin'

Re: Possible bug in getopts when required argument is not supplied

2015-11-13 Thread Griff Miller II
On Fri, November 13, 2015 1:02 pm, Dennis Williamson wrote: > Your opts string needs to begin with a colon to enable silent error > reporting and you need to handle the colon in your case statement as the > condition where a required argument is missing. Hi, Dennis - thanks for replying. I get

bash 4.3.42 does not link on Solaris 2.4

2015-11-13 Thread Klaus Ziegler - owner of sunfreeware.de
Configuration Information [Automatically generated, do not change]: Machine: sparc OS: solaris2.4 Compiler: cc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='sparc' -DCONF_OSTYPE='solaris2.4' -DCONF_MACHTYPE='sparc-sun-solaris2.4' -DCONF_VENDOR='sun' -DLOCALEDIR='/usr/share/locale'

Re: Possible bug in getopts when required argument is not supplied

2015-11-13 Thread Chet Ramey
On 11/13/15 11:13 AM, Griff Miller II wrote: > Note that in the last run, getopts does not detect that nothing was passed > via -a, even though -a requires it. Instead, it thinks the next switch > (-b) is the value of -a. Perhaps this was a conscious decision, so that > values starting with '-'

Re: redirecting a file descriptor to an array variable? Possible? How? RFE?

2015-11-13 Thread Greg Wooledge
On Thu, Nov 12, 2015 at 04:45:49PM -0800, Linda Walsh wrote: > I'm coming up with a null-record in my brain when I think > about this: I'd like to be able to record stdout and stderr > without using any temp files into bash array files, AND > record the status of the command executed. There is