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
@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?
@vaporeon_ @wallhackio i made a point of not teaching him backtick because you can’t quote it to purrevent splitting
@vaporeon_ @wallhackio (he did know this at some point though actually; it’s at least been mentioned to him on the fediverse befur. he just furgor)
@vaporeon_ @wallhackio i’m very much the type of cat to write code like it’s getting checked by a fairly strict linter at nearly all times
@aescling Does shellcheck detect this?
@aschmitz inadvertently
Line 3:
echo "hi `shellcheck` lovers"
^-- SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
Did you mean: (apply this, apply all SC2006)
echo "hi $(shellcheck) lovers"
@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`"?