ftp.nice.ch/pub/next/unix/network/news/rn.5.4.s.tar.gz#/rn/range.c

This is range.c in view mode; [Download] [Up]

#ifndef lint
static char * rcsid ="$Header: range.c,v 1.1 89/11/08 03:45:39 sob Locked $";
#endif
/*
***************************************************************************
This work in its current form is Copyright 1989 Stan Barber
This software may be distributed freely as long as no profit is made from
such distribution and this notice is reproducted in whole.
***************************************************************************
This software is provided on an "as is" basis with no guarantee of 
usefulness or correctness of operation for any purpose, intended or
otherwise. The author is in no way liable for this software's performance
or any damage it may cause to any data of any kind anywhere.
***************************************************************************
*/
/*
 * $Log:	range.c,v $
 * Revision 1.1  89/11/08  03:45:39  sob
 * Initial revision
 * 
 *
 */

#include <stdio.h>
extern char *rindex();
char * progname;

main(argc,argv)
char *argv[];
int argc;
{
    int x,y,i;


    if ((progname = rindex(argv[0],'/'))== NULL)
	    progname = argv[0];
    else progname++;
    

    if (argc != 3) usage();
    x = atoi(argv[1]);
    y = atoi(argv[2]);
    if (y < x) usage();
    y++;

    for (i=x;i < y;i++)
	printf("%d ",i);
    printf("\n");

    exit(0);
}

usage(){
    fprintf(stderr,"Usage: %s startnumber endnumber\n",progname);
    exit(-1);
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.