dotfiles

<-- duh.
Log | Files | Refs | LICENSE

commit ae057de2dfdf052a51abf00d8ef1a158dc720692
parent f0ac530e3e07e648d4cd263d405cca8df5b12cb1
Author: hhvn <dev@haydenvh.com>
Date:   Mon,  8 Mar 2021 17:15:46 +0000

.s/o/seq .s/m/m/seq.1o: seq replacement

This is the first commit with an experimental new way of shortening
messages.

Diffstat:
A.scripts/man/man1/seq.1o | 29+++++++++++++++++++++++++++++
A.scripts/openbsd-compat/seq | 29+++++++++++++++++++++++++++++
2 files changed, 58 insertions(+), 0 deletions(-)

diff --git a/.scripts/man/man1/seq.1o b/.scripts/man/man1/seq.1o @@ -0,0 +1,29 @@ +.Dd hhvn-obsd-compat +.Dt $PROGNAME 1 +.Sh PROLOGUE +These scripts are barebone replicas of some GNU programs that I miss on openbsd + +IMO, this is the lazy method of ensuring compatibility :) +.Sh NAME +.Nm seq +.Nd sequential number generation +.Sh SYNOPSIS +.Nm +.Ar LAST +.Nm +.Ar FIRST +.Ar LAST +.Nm +.Ar FIRST +.Ar INCREMENT +.Ar LAST +.Sh DESCRIPTION +.Ar FIRST +and +.Ar INCREMENT +default to 1. +.Sh SEE ALSO +.Xr hhvn-scripts 7 +.Xr hhvn-obsd-compat 7 +.Sh AUTHOR +.An hhvn Aq Mt dev@hhvn.uk . diff --git a/.scripts/openbsd-compat/seq b/.scripts/openbsd-compat/seq @@ -0,0 +1,29 @@ +#!/bin/sh + +case "$#" in + 1) + last="$1" + ;; + 2) + first="$1" + last="$2" + ;; + 3) + first="$1" + incr="$2" + last="$3" + ;; + *) + echo "usage: seq <last>" + echo " seq <first> <last>" + echo " seq <first> <incr> <last>" + exit 1 + ;; +esac + + +echo | awk -v "first=${first:-1}" -v "incr=${incr:-1}" -v "last=$last" ' + { + for (i=first; i <= last; i=i+incr) + print i + }'