read start end n=$start while [ "$n" -le "$end" ] do if [ $((n % 3)) -eq 0 ]; then echo "$n" else echo "$n" | grep -q '3' if [ $? -eq 0 ]; then echo "$n" fi fi n=$((n+1)) done