- Code: Select all
printf "%*s\n" $(((${#TEXT} + $COLUMNS)/2)) "$TEXT"
to center some Text in your .bashrc, you must do an
- Code: Select all
export COLUMNS
Else the variable is unset/empty. AFTER the Terminal is loaded (or you're logged in and see your PS1) the COLUMNS variable is set. This is since Sabayon 4 or 5. Not shure about this. Its just annoying.
So if you know a better solution than export this in the .bashrc, please tell me.