#
# usage:	center.sh
#
# abstract:	This Bourne Shell outputs a title string centered in 80
#		characters to standard output.
#
# note(s):      1. This routine must be called using a . (period)
#		2. The variable 'title' holds the title string.
#
# Copyright (c) 1995 by The MathWorks, Inc.
# $Revision: 1.1 $  $Date: 1995/10/23 18:07:58 $
#------------------------------------------------------------------------
#
	echo "$title" | awk '
#----------------------------------------------------------------------------
# blankhead is 40 characters
#
    BEGIN { blankhead = "                                        " }
	  { lend2 = 40 - (length($0) / 2 - length($0) % 2)
	    print substr(blankhead,1,lend2) $0 }'
#----------------------------------------------------------------------------
