initial commit

pull/1/head
Sam Hunter 2 years ago
parent b0ec677896
commit f8e226a153

10
box

@ -0,0 +1,10 @@
#! /bin/bash
# a crude box-around-the-text utility
readonly PROGNAME=${0##*/}
readonly VERSION="1.0"
readonly COLS=$((COLUMNS-4))
readonly FOLDWIDTH=$((COLS-2))
printf "+%${COLS}s+\n" " "|sed -e 's! !-!g;'
while read A ; do printf "| %-${FOLDWIDTH}s |\n" "$A" ; done < <(sed -e 's!\t! !g' $1 | fold -s -w${FOLDWIDTH})
printf "+%${COLS}s+\n" " "|sed -e 's! !-!g;'
Loading…
Cancel
Save