Various shell scripts for use on the RTC server. Not your official RTC stuff!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
463 B

#! /bin/bash
# A crude box-around-the-text utility
# Author:
readonly PROGNAME=${0##*/}
readonly VERSION="1.0"
readonly COLS=$((COLUMNS-4))
readonly FOLDWIDTH=$((COLS-2))
printf "+%${COLS}s+\n" " "|sed -e 's! !-!g;'
while IFS= read -r 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;'