#!/usr/bin/sed -f ## (c) Carlos Duarte ## Created: 04-Aug-96 ## Updated: - ## # center # # center all lines of a file, on a 80 columns width # # to change that width, the number in \{\} must be replaced, and the number # of added spaces also must be changed # # del leading and trailing spaces y/ / / s/^ *// s/ *$// # add 80 spaces to end of line s/$/ / s/ *$/&&&&&&&&/ # keep 1st 80 chars s/^\(.\{80\}\).*$/\1/ # split trailing spaces, into two halves, 1st for beg, 2nd to end of line s/\( *\)\1$/#\1%\1/ s/^\(.*\)#\(.*\)%\(.*\)$/\2\1\3/