Craig Maloney ☕ ✅ is a user on octodon.social. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.
Craig Maloney ☕ ✅ @craigmaloney

TFW you have a title in upper case and it's easier to bring up Python, put the string into a variable, and use foo.title() to title-case it.

· Web · 0 · 3

@craigmaloney Under bash you can type Alt-C to capitalise the word after the cursor (and Alt-U to uppercase, and Alt-L to lowercase).

@estebanm @craigmaloney Interesting, though this wouldn't have helped in this scenario as the whole text was in uppercase. But good to know nonetheless.

@craigmaloney Oh, at first I read "thought this wouldn't have" but I see now you wrote "though". It does work for me.

Or was it a typo and you did mean "thought"?

@craigmaloney Ever notice it's faster to use Python for shell scripting than Bash once you learn about subprocess.check_call and subprocess.popen

?

😉

@kemonine my rule is one a script gets over 10 lines I start wanting to write it in Python.

Worse; if it has branching logic I get really itchy to rewrite in Python.

@craigmaloney I'm with you.

I've been slowly re-writing everything in Python. Makes life a LOT simpler and I get to chain commands together for Zabbix integration much easier.

Plus Bash logic is nothing short of beyond the pale painful. *shudder*

The latest 'think' I did with Bash branching was a nightmare.

@craigmaloney Python is convenient for all kinds of things, isn't it? I learned it to teach a class (Numerical Analysis) and didn't want to have to learn Java (which all our students have to learn). Now most of our math majors get a couple of computer languages. I hope to find time to learn it better. Just in case you haven't done this and don't know it: Type "import antigravity" into Python. (If you already know, never mind.)