Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

For loop query...

$
0
0
Hi all...
I am using a for loop for another part of AudioScope...
Consider this code:-
Code:

for n in {0..100}
do
        if [ "${condition[$n]}" = "another_string" ]
        then
                break
        fi
done

This works perfectly except I am not sure if breaking out of a 'for' loop might cause problems further down the line if it doesn't reach its termination correctly.

Should a 'while' loop be used instead?

TIA...

Viewing all articles
Browse latest Browse all 16232

Trending Articles