I am trying to save the argument after "-ip" as a variable in the bash script:
if [ $# == 0 ]; then
        ARGS=""
else
        for var in "$@"
        do
                ARGS="$ARGS $var"
                if [ $var == "-ip" ];   then
                        getopts ip: $IP
                fi
        done
fi
echo $IP
I never tried 'getopts' in bash, I tried the first time as you can see above and failed literally.
Any help would be very appreciated,
Thanks
 
    