hi dear friends
I have the following (part of big ksh script)
while [[ $? -ne 0 ]]
do
print -n "ENTER VALID HOST IP"
read IP
CHECK_IP $IP # CHECK_IP is afuntion that check if IP is valid and return 0 or 1
done
as we see in the while the $? is always equal to 0 so we cant ask for the IP
the target of the loop is to ask IP address and activate CHECK_IP function in order to return 0 or 1
0 for valid IP
1 for BAD IP
but as I said in the begging I never asked about IP because $? always 0 (after "while" )
so my question
How to enable default 1 to $? so I will start the loop , or other suggestion?
lidai