mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-13 23:20:49 +02:00
Imported from ../bash-2.04.tar.gz.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#! /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
|
||||
Reference in New Issue
Block a user