I have created a script which takes parameters and arguments. I want to insert the --help argument.I already know how to parse normal arguments with -, but I don't know how to parse the -- ones.to parse optiopns for test.sh -h i use the following checkwhile getopts :h opt; do case $opt in    h ) {            echo help!!!            exit 1    } ;;esacdoneBut I want to have the option to call the script with test.sh --helpThanks in advance.P.S. I am using Ubuntu 12.04...but it doesn't really matter.Apparently I can't answer my own question if I have so less rep. I found the solution in one of the .sh scripts from /usr/bin  if test $# = 1; then    case $1 in      --help | --hel | --he | --h )        func_usage; exit 0 ;;      --version | --versio | --versi | --vers | --ver | --ve | --v )        func_version; exit 0 ;;    esac  fi
bash scripting add arguments
linux;bash;shell script;scripting
getopts cannot handle long arguments:$ ( set -- --help ; while getopts -- -help opt; do echo $opt; done )-helpIf you want to handle long arguments, you need to write your own parser.The GNU version of getopt does support parsing long options, but you'd be better off not using it; it's not portable, and it breaks on certain types of arguments. For example, it cannot properly parse arguments with whitespace in them.