this post was submitted on 05 Mar 2025
1663 points (100.0% liked)

Programmer Humor

21852 readers
1100 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 9 points 2 weeks ago (1 children)

Bash substitution is regex-level wizardry.

[–] [email protected] 7 points 2 weeks ago (3 children)

Slapping a $ before an environment variable name is "wizardry?"

[–] [email protected] 5 points 2 weeks ago (2 children)

Not quite that, but more the ${variable##.*} sort of thing.

[–] [email protected] 5 points 2 weeks ago

Right, so that's just the string manipulation functions. I already posted a link to the bible for this following a different reply to the same comment to which you replied.

[–] [email protected] 3 points 2 weeks ago

Back then, a pain in the ass. Nowadays, I just let an AI handle that. I used this crap for years and years and still cannot remember, which symbols you need in which order. And why should I remember? I'm not the computer. The computer should know, not me.

[–] [email protected] 5 points 2 weeks ago

interns be interning

[–] [email protected] 4 points 2 weeks ago (1 children)

Nope, the whole ${variable/regex/replacement} syntax

[–] [email protected] 8 points 2 weeks ago (1 children)
[–] [email protected] 11 points 2 weeks ago (1 children)
[–] [email protected] 3 points 2 weeks ago

Every time I have to do this I always go here. I can never remember the prefix suffix parts next time I do parameter substitution.