bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Somewhat off-topic, but hard to find better portability people.


From: Peter Seebach
Subject: Re: Somewhat off-topic, but hard to find better portability people.
Date: Wed, 17 Sep 2008 02:41:39 -0500

In message <address@hidden>, Ralf Wildenhues writes:
>Quoting the Autoconf manual:
>| `unset'
>|      In some nonconforming shells (e.g., Bash 2.05a), `unset FOO' fails
>|      when `FOO' is not set.  Also, Bash 2.01 mishandles `unset MAIL' in
>|      some cases and dumps core.

>So look for systems with those bash versions.

I can't find any.  The other question would be for the general idiom; are
there living shells where there simply isn't an unset command?  According to
Sven Mascheck's page, it was added in the SVR2 shell.  So, if my 3b1 still
worked (I doubt it does), it would probably work there...

>> "$@" (expanding to null, not an empty string, when no positional parameters)

>systems are listed for this, too:

>| `$@'
>|      One of the most famous shell-portability issues is related to
>|      `"$@"'.  When there are no positional arguments, Posix says that
>|      `"$@"' is supposed to be equivalent to nothing, but the original
>|      Unix version 7 Bourne shell treated it as equivalent to `""'
>|      instead, and this behavior survives in later implementations like
>|      Digital Unix 5.0.

Yes.

I can't find a V7 shell anywhere -- Solaris is SVR4 shell.  I haven't seen
Digital Unix in ages.  Are current versions still affected?  I'm afraid
I haven't got one.  I'm interested in a system someone might reasonably expect
to see a script run on today...  And yes, I know how dangerous it is to
think like that, but I think it can also be dangerous to get too caught up
in things which used to be a problem.  (Think how much simpler life would
be for zsh compatibility without triggering the ${1+"$@"} bug...)

>Sure.  If you're missing systems mentioned in the Autoconf manual,
>then they should be added.  Typically, if we find a newer system
>that still exposes an old bug, we list it.

The sort of rough cutoff I picked, perhaps arbitrarily, was "systems with Y2K
fixes".  So, Solaris 2+, but not Solaris 1/SunOS 4.

I've been getting utterly stunned pretty regularly throughout.  The only
system I've found so far, other than embedded systems (hi, busybox!), which
doesn't have printf(1) either in the shell or in the default $PATH, is SunOS
4 -- which I'm willing to mention once and then ignore at this point.

-s




reply via email to

[Prev in Thread] Current Thread [Next in Thread]