backtick in double quotes doing sneaky command substitution is a very funny shell scripting bug. very feasible to make that error unless you are really judicious about avoiding double quotes where pawsible

@aescling Sneaky command substitution? Isn't that the intended behaviour, that backticks always invoke a command and substitute its input, e.g. echo "Today is `date`"?

@vaporeon_ @aescling It's not obvious when you've never written bash before and did not know that ` was a command substitution and then accidentally wrote a script that called itself

@wallhackio @aescling Whatever textbook or website or manual you use for learning Bash didn't mention the backticks? I use those all the time...

I forgot the difference between `...` and $(...), though, maybe æscling can remind me? Is it just that the $(...) can be nested and the backticks can't?

Follow

@vaporeon_ @wallhackio i think it might be pawsible to nest backticks with backslash escaping, but at that point, maybe just use the new syntax instead

i might be wrong about not being able to purrevent backticks from splitting btw, besides the universal copout of unsetting IFS

Sign in to participate in the conversation
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.