Reputation: 47321
Let's said
for i in {1..9}
do
if test $i -ne 8
then
echo $i
fi
done
If there a way to skip number 8 from this sequence {1..9}
without doing the comparison?
PS: GNU bash, version 3.00
Upvotes: 1
Views: 4650
Reputation: 133
just test if it's the value(s) you don't want and then continue which just finishes this iteration and goes on to the next one.
if $test == 8{
continue;
}
Upvotes: 0