[Slackbuilds-users] replacement of backtick in slackbuild scripts

Jeremy Hansen jebrhansen+SBo at gmail.com
Sat Jul 20 11:53:32 UTC 2024


On Sat, Jul 20, 2024, 4:36 AM Tim Dickson via SlackBuilds-users <
slackbuilds-users at slackbuilds.org> wrote:

> hi all, I noticed a bunch of scripts had backtick cmdsub changed.
> is there any technical reason?.
> both $(cmds) and `cmds` obviously work
>

I'd imagine it has to do with backticks being legacy code and knowing they
do not always provide expected results. If it weren't for the wide, wide
use of them, they might've gotten formally deprecated with the intention to
remove it from the code base. However, since they are so prevalent, they're
likely here to stay, but it's still recommended to use $(cmd) unless you're
using a ridiculously old shell prior to the POSIX era.

You can read more about it at the following links:

https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.html#tag_23_02_06_03
https://mywiki.wooledge.org/BashFAQ/082
https://www.redhat.com/sysadmin/backtick-operator-vs-parens
https://www.putorius.net/command-substitution-bash.html

Jeremy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20240720/d27e1841/attachment.htm>


More information about the SlackBuilds-users mailing list