I need to display
--------------------------- word ----------------------------
with the word right in the middle of the horizontal line and set the length of the horizontal line to that it fits the used terminal width.
I thought about using a similar expression than
printf '%*s\n' "$(tput cols)" '' | tr ' ' -