mksh tag cloud

Sponsored by
HostEurope Logo

mksh tag cloud

All 1 2 3 4 5 6 7 8

mksh R38 released

31.05.2009 by tg@
Tags: bug mksh

The MirBSD Korn Shell R38b has been released. It adds portability to QNX 6.4, a built-in base64 decoder and encoder written in mksh itself, and most importantly fixes a regression introduced in R38 causing memory corruption.

This – and a lot more bugs – were discovered while porting Git (resp. running its test suite) for Michael Gebetsroither (grml).

With another mksh release out, and the first feedback (actually a patch with explanation – naaina ported it to the newly released QNX 6.4, 10x) already in, I would like to request user feedback if mksh compiles okay for them, the regression test suite results, and if it does its job – especially on the more obscure platforms. Current plans for R36b are mere portability and bug fixes, and maybe some more of the Syllable, Plan 9 or Haiku issues touched if someone does it.

On the other hand, I'm really glad I get feedback, even patches from people I've never heard of beforehand, which even touch documentation as it should be. One had the luck of adding a feature that had been, independently, requested in IRC mere days beforehand. You're welcome ;)

Let me plug a link to the fine manual page mksh(1) or its PDF version.

Thanks to all users as well, we cracked the 100 in Debian popcon a few days ago (102), even though it's down a tad right now, to 94.

Plans are to get promoted to Arch Linux Community from AUR, included into Mac OSX, Minix, pkgsrc® (as bootstrap shell) and QNX by default, and the usual world domination in general. Hey, I'm fixing dietlibc bugs on Launchpad now, so low I've sunk, so gimme some rest.

mksh R38 released

27.05.2009 by tg@
Tags: mksh

The MirBSD Korn Shell R38 has been released. Most prominently, our developer wbx@ (Waldemar Brodkorb) has suggested to allow for expansion of “!string” style lines, and several things (string lengths, substring expansion) have been made more aware of UTF-8. Grab it as long as it’s hot!

mksh semantics for evaluating substring expansion ${strvar:pos:len} and string length ${#strvar} expressions has changed today. These operations now work on characters, not on bytes. Characters are octets in non-UTFMODE (which is pretty much the same as bytes, because mksh(1) is a BSD application and, as per style(9), allowed to assume certain things about the environment) and MirOS OPTU-8 multibyte character sequences in utf8-mode.

This means things like typeset -Uui16 -Z7 wc=1#${str::1} now do the right thing (getting you the MirOS OPTU-16 wide character value of the first character in the str).

mksh R38 will thusly be released RSN.

Solución al reto del script

16.05.2009 by tg@
Tags: mksh

asarch ha escrito un artículo acerca de cómo se usa la función isatty(3) de para verificar si un script tiene datos en stdin, quizas en "$@", o para imprimir su uso.

Para el soporte oficial del mksh eres bienvenido en su canal (en inglés, ya que no todos hablan el castellano) en #!/bin/mksh (sí, sí es un nombre válido XD) del Freenode PDPC (irc.freenode.net:6667).

Update: asarch ha corregido mi español... ¡gracias!

mksh $(…) evaluation bug

22.04.2009 by tg@
Tags: bug mksh

RedHat BZ#496791 is another example of a bug I documented better in the commitids 10049EF448F5F89A278 and 10049EF493039137B14 in mksh(1).

The gist is: $(…) are not parsed recursively but by a lexer hack, namely merely looking at matching parenthesēs; this needs to go away. Until then, this bug cannot be fixed.

And while at it, ((foo); bar) subshells need to be fixed so that they are not parsed as ((…)) arithmetic expression with a failure upon encountering a sole closing parenthesis.

The mksh plans list this.

Not an mksh bug

08.04.2009 by tg@
Tags: bug debian mksh

When R37c was brought out, I fixed a bug on (among others) IA64. The simple memory allocator added a pointer (or two, in Espie's) to the storage, placed before what the user got. Of course, gcc wanted to align the struct not taking this into account, failing evilly. Luckily, another FTBFS was not my fault, but sigsetjmp(3) was merely broken on S/390 with dietlibc; waldi fixed it in the meanwhile, but I uploaded another version of mksh to Debian for now whose mksh-static binary links against glibc instead and added me a TODO bug.

All the testsuite failures are certainly interesting though; the hppa one looks like a bug in ed(1) there; as to the others, either Perl, or binfmt_misc was configured to accept or drop (but not reject) shebangs præfixed with a BOM. Whatever.

Maybe I can now finally go back to working on MirBSD instead? :D
After all, we want a new snapshot (for NetInstall, at least).

The MirBSD Korn Shell R37c has been released. You do not need to update if you are already running R37b, unless one of the following items affects you:

  • Fix a file descriptor bug on Minix 3 (all users are affected, unless their Minix 3 version supports >64 fds already)
  • Support ACK on Minix 3 by means of a workaround
  • Change structure alignment and padding (affects people getting a SIGBUS or sometimes SIGSEGV on strict-alignment arches, e.g. IA64)

Since bsiegert@ has not indicated willingness to take over Freshmeat announcements of mksh releases, and I am almost unable and certainly unwilling to, this ceases our use of said site's services. Please use https://www.mirbsd.org/tag_mksh.rss to keep informed about things related to the MirBSD Korn Shell.

The MirBSD Korn Shell R37b has been released, incorporating a plethora of changes from R37, which was only available from CVS, and a few news by itself.

The new ‘-combine’ Build.sh option (gcc4 only) is about as noteworthy as the Minix 3 support. Users of Emdebian, FreeWRT and Beastiebox however will find that the new memory allocator has less overhead, i.e. the shell shrank in size. On the other hand, it is now much more standards compliant, especially wrt. “set -e”.

As such, mksh R37b is a strongly suggested upgrade.

Note: Freshmeat has a new website. I am utterly confused from it, both in Lynx and Opera, so I don’t know if this announcement has made it to there. I probably will cease to use Freshmeat, similarily as Slashdot, when it became unusable in Lynx. Damn “Web 2.0”!

mksh at Apple again

05.04.2009 by tg@
Tags: mksh

laffer1 remembered me of Benny’s Apple bug report about mksh inclusion into their base system. He also did it back then, as requested, and the bug #6735470 would be the result. Unfortunately, one still cannot get a publicly accessible version of them.

By the way, the R37b version is out.

[rant] FreeBSD® sucks!

29.03.2009 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 similarily...

mksh, the MirBSD™ Korn Shell, is not only the MidnightBSD /bin/ksh, it is now their default /bin/sh as well! See the commit message for details.

laffer1@mnbsd and tg@mbsd worked together to create compatibility code for the FreeBSD® ash extensions; the version R37 of mksh(1) used already has been proven as /bin/sh in MirBSD and FreeWRT for some time, and Debian as well, which provided valuable corner case tests leading to eventual bugfixes.

We can only suggest others follow ☺ Apple, pkgsrc®, where are you?

All 1 2 3 4 5 6 7 8

MirOS Logo