Experimente o script abaixo. Ele detectará o tamanho do terminal para cada palavra de entrada e será atualizado dinamicamente se você redimensionar o terminal enquanto estiver em execução.
#!/usr/bin/env bash
## Change the input file to have one word per line
tr ' ' '\n' < "$1" |
## Read each word
while read word
do
## Get the terminal's dimensions
height=$(tput lines)
width=$(tput cols)
## Clear the terminal
clear
## Set the cursor to the middle of the terminal
tput cup "$((height/2))" "$((width/2))"
## Print the word. I add a newline just to avoid the blinking cursor
printf "%s\n" "$word"
sleep 1
done
Salve-o como ~/bin/foo.sh, torne-o executável ( chmod a+x ~/bin/foo.sh) e forneça seu arquivo de entrada como seu primeiro argumento:
foo.sh file