This can be done using a C program calling standard C library functions only. Then this source would be OS independant.
To do this with Unix shells passing the range on the command line, read about shell programming (especially passing command line parameters, conditions, and arithmetric expressions). For the Linux bash shell see the
Bourne-Again SHell Manual[
^].
An implementation might look like this:
if [ x"$2" == x ]; then
echo "Usage: PrintRange <start> <end>"
exit
fi
let i=$1
if ((i & 1)); then
let i+=1
fi
while ((i <= $2)); do
echo "$i"
let i+=2
done
Your question seems to be homework. I would not post code in this case. But I guess you must explain what you have done and why. So you must understand the above shell script before using it.