I get the same response on Ubuntu and Gentoo.
I am not a bash expert but would make the observation that (note multiple 
quotes):

#!/bin/bash
while getopts "a:bc" flag '-a test' '-b' '-c'; do
  echo "$flag $OPTARG"
done

in test2 will generate:

pe...@vostro ~/Desktop $ ./test2.sh
a  test
b 
c 

as will:

pe...@vostro ~/Desktop $ ./test1.sh '-a test' '-b' '-c'
a  test
b 
c 

However it appears that the parsing is not consistent.

-- 
Bash script getopts strange behaviour
https://bugs.launchpad.net/bugs/522591
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to