Bash substitution is regex-level wizardry.
Programmer Humor
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
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
Slapping a $ before an environment variable name is "wizardry?"
Not quite that, but more the ${variable##.*}
sort of thing.
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.
Nope, the whole ${variable/regex/replacement}
syntax
All the string manipulation functions are easy: https://tldp.org/LDP/abs/html/string-manipulation.html
interns be interning
It seems like it does stuff differently for the sake of it being different.
When I was finishing of my degree at Uni I actually spent a couple of months as an auxiliary teacher giving professional training in Unix, which included teaching people shell script.
Nowadays (granted, almost 3 decades later), I remember almost nothing of shell scripting, even though I've stayed on the Technical Career Track doing mostly Programming since.
So that joke is very much me irl.
Meh. I had a bash job for 6 years. I couldn't forget it if I wanted to. I imagine most people don't use it enough for it to stick. You get good enough at it, and there's no need to reach for python.
Incredibly true for me these days. But don't fret, shellcheck and tldp.org is all you need. And maybe that one stackoverflow answer about how to get the running script's directory
The older you get, the more things are like programming in bash.