ash: "source <nonexistent file>" makes ash exit?

Joshua Judson Rosen jrosen at harvestai.com
Mon Mar 18 18:48:58 UTC 2013


On 2013-03-18 14:17, 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;

Ugh--I take it back about dash/ash--dash/ash actually behave according
to POSIX, here. :\

I was running a script that used "source" instead of ".", and that gives
a result that's uncannily-similar to the what bash normally does and
what busybox does after applying my patch. My ksh installation apparently
has "source" set as an alias, as well.

I think the other points still stand, though:

> portable scripts already have to do ". $file || exit" if they actually want
>the POSIX behaviour....
>
> So, even ignoring the unfixable race condition, there's a porting effort
> required to make shell scripts work with busybox ash as it is.
>
> Given the other places where busybox favours de facto standards over POSIX
> (e.g.: ls reports in 1-kB block rather than 512-byte blocks, command
> option-parsing doesn't stop at the first non-option parameter),
> doing the same in dotcmd() seems reasonable.

-- 
"Don't be afraid to ask (λf.((λx.xx) (λr.f(rr))))."


More information about the busybox mailing list