[Slackbuilds-users] replacement of backtick in slackbuild scripts

B. Watson urchlay at slackware.uk
Sat Jul 20 17:12:11 UTC 2024



On Sat, 20 Jul 2024, Tim Dickson via SlackBuilds-users wrote:

> hi all, I noticed a bunch of scripts had backtick cmdsub changed.
> is there any technical reason?.

Well, we already had a bunch of scripts that were still using "chown
-R user.group" syntax, which (as of the latest coreutils update) causes
a warning:

chown: warning: '.' should be ':': ‘urchlay.users’

Personally, were I in Pat's shoes, I'd just patch coreutils to get rid
of that warning. But then he's got a lot more important stuff to worry
about...

Near as I can tell, the problem with using a dot is that user
and group names are allowed to include a dot, which would make it
ambiguous. Not sure this is a real-world issue (does anyone ever
create usernames with dots in them, for real?)

So we decided to change those scripts to use the colon... and while we
were at it, decided to "fix" the backticks too. Not that backticks are
really "broken".

I'm actually going to add a warning to sbolint about the chown-with-dot
syntax. Not a fatal error, not yet... but it loox to me like the GNU
folk really want the chown-with-dot syntax to go away someday.

I won't be adding a backtick warning to sbolint, because it'd be hard
to implement without false positives. Makefiles and upstream scripts
use backticks too, and we have scripts that use sed commands with
backticks inside the quoted sed argument... examples: system/makeself
has this:

sed -i -e "s,^HEADER\=\`dirname \"\$0\"\`,HEADER=/usr/share/$PRGNAM," makeself.sh

The backticks there belong there (they match backticks inside the
makeself.sh script). It'd be hard for sbolint to parse enough shell
syntax to know that, though (essentially I'd be rewriting the shell
in perl).


More information about the SlackBuilds-users mailing list