[sr #111102] ksh93 oddity w.r.t. ${1+"$@"} on AIX (for section "Portable Shell"?)

anonymous <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.bugs
Message-ID <[email protected]>
Follow-up Comment #2, sr #111102 (group autoconf):

Thanks, I wouldn't have thought that this is worth such a long patch.

Two minor nits:

+verbose+
You may see usages like @samp{$@{1+"$@@"@}} in older shell scripts
designed to work around a portability problem in ancient shells.
Unfortunately this runs afoul of bugs in more-recent shells, and
nowadays it is better to use plain @samp{"$@@"} insteadl.
                                          typo: ^^^^^^^^
-verbose-

+verbose+
For many years shell scripts worked around this portability problem by
using @samp{$@{1+"$@@"@}} instead of @samp{"$@@"}, and you may see this
usage in older scripts.  Unfortunately, @samp{$@{1+"$@@"@}} does not
work with @command{ksh93} M 93t+ (2009) as shipped in AIX 7.2 (2015),
as this shell drops trailing arguments:
    probably insert "empty" ^ here?
-verbose-

BTW, what I haven't tested yet (and no AIX around right now):

* whether *non-trailing* empty arguments are dropped as well

* whether the ${foo+"$bar"} mechanism is flawed in general on that shell
(after all, the symptoms smell of double evaluation)

Could try that on Monday.



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/support/?111102>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCZq4F4wAKCRCqLAuaBUf3
TsaHAP9gs3GlcoggFkqNI7hmx1lZuQZCxr6ob8nzHQoJO6VZpQD5AS+v7u+I6qTW
Hft1gRI/DIyT+ekVmUeHgZxUqf8iyQA=
=lx+d
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.