From e788eec085ccbd46ecc80062b119f32df36735b1 Mon Sep 17 00:00:00 2001 From: dtb Date: Sat, 13 Aug 2022 16:36:00 -0400 Subject: [PATCH] remove half-baked seq(1) --- bin/seq | 52 ---------------------------------------------------- 1 file changed, 52 deletions(-) delete mode 100755 bin/seq diff --git a/bin/seq b/bin/seq deleted file mode 100755 index f1d3215..0000000 --- a/bin/seq +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh - -# There are many bugs and limitations with this implementation as opposed to -# others, particularly NetBSD's. This should probably be rewritten in C. - -argv0="$0" - -doublecheck() { - ! str isdigit "$1" \ - && printf "%s: %s: Not an unsigned integer.\n" \ - "$argv0" "$1" 1>&2 \ - && exit 1 \ - || return 0 -} - -error() { - printf "%s: Internal error.\n" - "$argv0" 1>&2 - exit 1 -} - -usage() { - printf "\ -Usage: - %s [last] - %s [first] [last] - %s [first] [increment] [last] -" "$argv0" "$argv0" "$argv0" 1>&2 - exit 1 -} - -test -n "$1" && test -z "$4" || usage - -test -n "$3" && doublecheck "$3" -test -n "$2" && doublecheck "$2" -test -n "$1" && doublecheck "$1" - -# all args are guaranteed to be positive integers; no need to quote variables - -if test -n "$3"; then first=$1; increment=$2; last=$3 -elif test -n "$2"; then first=$1; increment=1; last=$2 -else first=1; increment=1; last=$1 -fi - -i=$first -while true; do - printf "%s\n" $i - i=$(printf "%s %s + p\n" $i $increment | dc) - printf "%s %s - p\n" $last $i | dc | grep '\-' >/dev/null 2>&1 \ - && break \ - || continue -done