Skipping a line and reading another line in the shell script while loop

I have code that reads line by line, using a while loop. Inside the while loop, I have certain conditions. Is there any way by which I can skip the current line and read the next line based on the condition? Let me be precise:

while read Line
do
    //some sample conditions
    a=$Line
    if [ "a" == "b" ]
        //i want to go to the next line from this point. 
done < **inputfile**

Any help would be greatly appreciated.

+3
source share
2 answers

What about:

while read Line
do
    # some sample conditions
    a=$Line
    if [ "$a" == "$b" ] # I assume this is not "a" == "b"
        # i want to go to the next line from this point. 
        read Line
        a=$Line
done < **inputfile**
+1
source

All Articles