Developers’ Weblog

FOSS hosting by
HostEurope Logo

Developers’ Weblog

⚠ This page contains old, outdated, obsolete, … historic or WIP content! No warranties e.g. for correctness!

All 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

[rant] FreeBSD® sucks!

2009-03-29 by tg@
Tags: bug mksh snippet

How about this:

	tg@herc:~ $ /bin/sh -c 'echo "0=($0) 1=($1) 2=($2) 3=($3)"' -- a "b c"
	0=(--) 1=(a) 2=(b c) 3=()
	tg@herc:~ $ nbsh -c 'echo "0=($0) 1=($1) 2=($2) 3=($3)"' -- a "b c"
	0=(--) 1=(a) 2=(b c) 3=()

Heck, not just NetBSD® ash, and almost any shell Debian can dig out (bash pdksh ksh93 zsh dash posh) behaves the same as mksh.

MidnightBSD (DragonFly and FreeBSD too):

	tg@mnbsd:~ $ /bin/sh -c 'echo "0=($0) 1=($1) 2=($2) 3=($3)"' -- a "b c"
	0=(a) 1=(b c) 2=() 3=()

And the best thing of all: I am to "fix" this in mksh, as the old FreeBSD® ash is documented to have that weird behaviour. (Well, there's always -DMKSH_BINSHREDUCED...)

This is not a fault of MidnightBSD (except they could fix mports to behave more POSIXish; after all, I had to do that to MirBSD and MirPorts often enough), don't get me wrong. It just surprised me, and since I'm glad they switched to mksh as /bin/sh I basically had to debug it.

I don't remember any more what NetBSD® 1.5 did that its /bin/sh could not be replaced by mksh, but they fixed it in 1.6 – K?buntu (the LTS version) fscks up similarly...

MirBSD Logo