scp3.sh regression test fails if scp not already installed

Thorsten Glaser t.glaser at tarent.de
Tue Jul 26 07:58:30 AEST 2022


On Sat, 23 Jul 2022, Darren Tucker wrote:

> Solaris 11 it's ksh in disguise and does but will complain about
> backticks (under at least some conditions).

The accent-gravis form of command substitution is nōn-portable in
at least one important regard: the handling of double quotes.

In general, you can have double quotes *either* outside *or* inside
the accent-gravis command substitution…

	echo "foo  `echo bar`  baz"

	echo foo `echo "$bar"` baz

… but NOT both:

	echo "foo  `echo "$bar"` baz" # IS AN ERROR

This is because some shells priorise the accent-gravis over
the double quote, some shells priorise the double quote higher.

In general, it’s unsafe to use. I do use it in the build script
for mksh, because that one has to be portable, but for most uses
it might be sensible to require the shell to be somewhat capable.

(mksh/Build.sh requires the shell to have functions; some very
old ash variants lacked them, but this is where I draw the line…
GNU autoconf is generated so they can expand inline all the time,
but for hand-written scripts, this isn’t tenable.)

bye,
//mirabilos (mksh developer)
-- 
Infrastrukturexperte • tarent solutions GmbH
Am Dickobskreuz 10, D-53121 Bonn • http://www.tarent.de/
Telephon +49 228 54881-393 • Fax: +49 228 54881-235
HRB AG Bonn 5168 • USt-ID (VAT): DE122264941
Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg

                        ****************************************************
/⁀\ The UTF-8 Ribbon
╲ ╱ Campaign against      Mit dem tarent-Newsletter nichts mehr verpassen:
 ╳  HTML eMail! Also,     https://www.tarent.de/newsletter
╱ ╲ header encryption!
                        ****************************************************


More information about the openssh-unix-dev mailing list