[Slackbuilds-users] replacement of backtick in slackbuild scripts
Lockywolf
for_slackbuilds-users_mlist_2023-04-21 at lockywolf.net
Sat Jul 20 11:45:24 UTC 2024
Backticks are a worse practice because parsing delimiters based on
parity instead of them being different is needlessly hard. Just try
adding unintended backticks or quotation marks in a file using a naive
parser and observe syntax highlighting fly to the moon.
Moreover, $() can be nested, while backticks cannot, that is proper
syntax composes much better. I.e.
echo $(ls $(echo "."))
The only reason of using backticks is really compatibility with obscure
commercial UNIXes, but I doubt you'd like to compile SlackBuilds on
those.
Tim Dickson via SlackBuilds-users <slackbuilds-users at slackbuilds.org> writes:
> hi all, I noticed a bunch of scripts had backtick cmdsub changed.
> is there any technical reason?.
> both $(cmds) and `cmds` obviously work
>
> just interested, as i didn't notice any announcement about a preferred style
> (and I tend to use backtick method myself :-) )
> regards, Tim
--
Your sincerely,
Vladimir Nikishkin (MiEr, lockywolf)
(Laptop)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20240720/07afdfb9/attachment.asc>
More information about the SlackBuilds-users
mailing list