#!/bin/sh # [ ] in a loop: the test builtin, with argument vectors and lookups. i=0 n=0 while [ $i -lt 100000 ]; do if [ "$i" != 7 ] && [ -n "$i" ]; then n=$((n + 1)); fi i=$((i + 1)) done echo $n