1. 程式人生 > >用shell實現打印600-700 之間的偶數

用shell實現打印600-700 之間的偶數

shell

#!/bin/bash
for i in {600..700}
do
count=`expr $i % 2` 
if [ $count -eq 0 ]
then
out="$out $i"
fi
done
echo $out

本文出自 “luosea” 博客,請務必保留此出處http://luosea.blog.51cto.com/8476080/1928081

用shell實現打印600-700 之間的偶數