#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#define NULLCHK(S) if ((S) != NULL)\
exit(1)
/*
* A basic implementation of seq(1). Supports neither floating-point bounds nor
* custom increment values.
*/
int
main(int argc, char **argv) {
if (argc < 2 || argc > 3)
exit(2);
long long lo, hi;
const char *errstr = NULL;
lo = (argc == 2) ? 1 : strtonum(argv[1], LLONG_MIN, LLONG_MAX, &errstr);
NULLCHK(errstr);
hi = strtonum(argv[argc - 1], LLONG_MIN, LLONG_MAX, &errstr);
NULLCHK(errstr);
for (long long i = lo; i <= hi; i++)
printf("%lld\n", i);
exit(0);
}
for comparison, a snippet of the 706-line gnu version Afficher plus
@mallaidh why