Browse Source

preserve spaces and backslashes

master
Sam Hunter 4 months ago
parent
commit
1f485f9366
  1. 2
      box

2
box

@ -6,5 +6,5 @@ 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})
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;'

Loading…
Cancel
Save