#!/usr/bin/muawk
# range: generate ranges 
# (C) 2001, m. Andreoli for MuLinux


BEGIN	{
	n=split(arg,opts)	

	#------------
	# syntax
	#-------------

	if ( opts[1] == "-h" || n==0 ) {
		printf("Usage: range min max [step] -- step is Real/Int \n");
		exit
	}

	min=opts[1]; max=opts[2]; step=1
	if ( n == 3 ) step=opts[3]

	if ( match(step,"\.") !=0 ) conv="%.1f "
		else  conv="%d "
 
	for (i=min; i<=max; i=i+step ) printf(conv,i)


	}
