I'm creating a simple console based script using shell script.It will be run on my bash shell Its a simple menu based driven display some set of options.
Now I want to do center align the text depending on the screen size. How do I align the text at center of the screen?Please assis me
Finally I found the solution:)
On BSD-based systems, including MacOS, the
fmt
utility has a-c
flag to center text.Unfortunately, GNU
fmt
has an incompatible -c flag and no alternative for centering.Simple Perl solution: