Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • If switching to vim is an option, it's just :center there (based on the textwidth aka tw setting). Commented Dec 24, 2022 at 8:22
  • 1
    Does this answer your question? Center text with printf Commented Dec 24, 2022 at 8:43
  • Regarding your most recent edit: bash answers were suggested as this is the most common shell in use, and you did not specify a particular shell in the question. Note also that my own answer did already have a sh-only part to it, which I hope I have now pointed out a bit more explicitly. Commented Dec 24, 2022 at 9:42