While hacking today, I needed to center some text, normally I do that in BBEdit ...

@mdhughes@appdot.net

While hacking today, I needed to center some text, normally I do that in BBEdit but this was in shell.

Am I just missing an obvious shell command? for 40 years? Quick apropos or searching didn't turn one up..

Anyway, here's align.py.
no args or -c: Center, -l: Left, -r: Right
-w N: set width if not shell columns.

(WHICH, Python can't get w from os.environ["COLUMNS"] or stty size, had to use shutil. WEIRD.)
#unix #python