use getopt in shell script
Hi,
I want to use getopt(1) to check the shell script's option and its' option arguments!
e.g.
test.sh --version|-V
test.sh --update {a | b}
when i type:
test.sh --up
it should prompt that it can not recognize --up this option, other than lack of option arguments
test.sh --update
it should prompt that it lacks of option arguments
i wrote this shell script:
#!/bin/bash
ARGS=`getopt -o ab:c:: -l a-long,b-long:,c-long:: -- "$@"`
but, when i input:
./test.sh --b-lo
it prompts that the --b-lo lacks of arguments, other than it can not recognize it
|