I am using an if condition inside a for loop. If the if condition returns yes, then I'd like to go to the start of the for loop again. Is this possible in bash?
#!/bin/bash
for i in /apps/incoming/*.sql
do
j=$(egrep "[A-Z]{6}[ ]{1}[@abc_id]{10}[ ]{1}[=]{1}[ ]{1}[0-9]*" $i | awk '{ print $4 }')
#echo $j
#Query database
export ORACLE_HOME=/apps/uc/tmd/oracle/instantclient_11_2
export LD_LIBRARY_PATH=/apps/uc/tmd/oracle/instantclient_11_2
sqlplus=/apps/oracle/instantclient_11_2/sqlplus
tmprnt=$($sqlplus -s abcsd/sakfdj@'(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = odsakjfldkjf)(PORT = 1111)))(CONNECT_DATA =(SERVICE_NAME = SFDDFD)(SRVR = DEDICATED)))' << EOF
SELECT name from blabla where abc_id='$j';
EOF)
if `echo ${tmprnt} | grep "${searchString1}" 1>/dev/null 2>&1`
then
GO TO the start of FOR IN loop and run the query again.
So if above tmprnt variable inside the IF condition matches the search string, then I'd like to run the thing again (The SQL query return "no rows selected" sometimes but it somehow returns correct results in we run again). I know there is no GO TO in bash. Please suggest a way out.