#! /bin/bash # BASH script to center all text in the middle of 79-column width. # Leading white spaces are insignificant and no trailing spaces appear # at the end. # # First written : S Gowtham, Sun, 09 Apr 2006 08:47:20 -0400 # Last modified : S Gowtham, Sun, 09 Apr 2006 08:47:20 -0400 # if [ "$1" != "" ]; then sed -e :a -e 's/^.\{1,77\}$/ &/;ta' -e 's/\( *\)\1/\1/' $1 > $1.calign echo "Open $1.calign" fi