Question

    syntax of loops in shell scripting?

    A for i in $( ls ); do echo item: $i done Correct Answer Incorrect Answer
    B #!/bin/bash COUNTER=0 while [ $COUNTER -lt 10 ]; do echo The counter is $COUNTER let COUNTER=COUNTER+1 done Correct Answer Incorrect Answer
    C #!/bin/bash COUNTER=20 until [ $COUNTER -lt 10 ]; do echo COUNTER $COUNTER let COUNTER-=1 done Correct Answer Incorrect Answer
    D Only 1 and 2 Correct Answer Incorrect Answer
    E All three are correct Correct Answer Incorrect Answer

    Solution

    The correct answer is E

    Practice Next