Initial release.

This commit is contained in:
hjp 1998-08-02 13:51:49 +00:00
parent 672f140c05
commit f6fd7880a0
2 changed files with 52 additions and 0 deletions

22
count/GNUmakefile Normal file
View File

@ -0,0 +1,22 @@
include GNUmakerules
include GNUmakevars
acctfix:
install: $(ROOT)/usr/local/bin/count $(ROOT)/usr/local/man/man8/count.8
install_all:
$(MAKE) install ROOT=/nfs/wsrdb
$(MAKE) install ROOT=/nfs/wsrcom
$(MAKE) install ROOT=/nfs/wifosv
$(MAKE) install ROOT=/nfs/ihssv
$(MAKE) install ROOT=/nfs/wsrtest
$(ROOT)/usr/local/bin/%: %
$(INSTALL) $< $@
$(ROOT)/usr/local/man/man8/%.8: %.man
$(INSTALL) $< $@
clean:
rm count

30
count/count.c Normal file
View File

@ -0,0 +1,30 @@
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
unsigned long start = 0;
unsigned long stop = ULONG_MAX;
unsigned long i;
switch (argc) {
case 0:
case 1:
break;
case 2:
stop = strtoul(argv[1], NULL, 0);
break;
case 3:
start = strtoul(argv[1], NULL, 0);
stop = strtoul(argv[2], NULL, 0);
break;
default:
fprintf(stderr, "Usage: %s [[start] stop]\n", argv[0]);
exit(1);
}
for (i = start; i < stop; i++) {
printf("%d\n", i);
}
return 0;
}