6

Shell script query - How do I achieve the results

view full story
linux-howto

http://www.linuxquestions.org – Hey Guys, I am not sure how do I achieve the result but here is the story. I have a script which prompts for the IP Address and read that value and validate if reachable. If not then it should keep on prompting until the IP is reachable. I tried using until loop as well as while loop but dang.. Any help would be much appreciated Here are the codes #!/bin/bash IP_Feed () { echo -n "Give me IP : " read IP } IP_Feed echo "Checking If IP is reachable" ping -c 2 -q -n $IP -W 5 > /dev/null while [ $? -ne 0 ] do IP_Feed done (HowTos)