|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /proc/self/root/usr/share/doc/bash-3.1/scripts/ |
Upload File : |
#! /bin/bash
#
# center - center a group of lines
#
# tabs in the lines might cause this to look a little bit off
#
#
width=${COLUMNS:-80}
if [[ $# == 0 ]]
then
set -- /dev/stdin
fi
for file
do
while read -r
do
printf "%*s\n" $(( (width+${#REPLY})/2 )) "$REPLY"
done < $file
done
exit 0