On 2013-03-18 15:44, Mike Frysinger wrote:
On Monday 18 March 2013 14:17:42 Joshua Judson Rosen wrote:
`luckily', the other popular bourne shells (e.g.: bash, dash/ash, ksh) seem
to all actually behave contrary to POSIX on this matter; portable scripts
already have to do ". $file || exit" if they actually want the POSIX
behaviour....

eh ?  have you actually tried running those shells ?

Yes, though see the last couple of messages I sent:

    http://lists.busybox.net/pipermail/busybox/2013-March/079071.html
    http://lists.busybox.net/pipermail/busybox/2013-March/079072.html

I could try to plead `principle of least astonishment', but I think I'll
go with `I'm not usually this dumb, I swear' instead :\

On the up side, several people just learned about "command ." as a result
of my flub....

Though, actually--the points about compatibilty with `posix bash' and ksh
do still stand, it's just that the details are somewhat finer that I initially
thought:

    * as I mentioned at the start of the thread, it appears that bash in
      posix mode *did not* abort previously to version 4.2--at least,
      version 4.1 (which is what I have on some Debian 6.0 and OpenSuSE
      servers, and which I believe is also current as of Red Hat EL 6)
      doesn't abort when either "." or "source" fails to find/read a file.

      Given how widespread bash 4.1 is at this point, and how long it
      it will be before everyone writing writing shell scripts against
      bash upgrades to 4.2, there may still be a legitimate compatibility
      issue here.

    * ksh doesn't abort when the using the "source"--it aborts only if
      the command used is "." per se. I thought this might be a Debian patch,
      but it looks like it's an upstream addition from 2004. So, the
      fact that ENABLE_ASH_BASH_COMPAT makes busybox provide a "source"
      command that `looks the same but behaves differently' seems like
      a legitimate compatibility issue.


I can adjust my patch so that busybox differentiates between "." and "source".

Actually, I might even be able to make a smaller, more straightforward patch
by just converting "source" from a normal command into an alias like ksh uses.

Thoughts?

--
"Don't be afraid to ask (λf.((λx.xx) (λr.f(rr))))."
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to