1 2set -- -x -y 3getopts :x var || echo "First getopts bad: $?" 4getopts :x var 5r=$? 6[ r != 0 ] && [ "$OPTIND" = 3 ] 7