mksh tag cloud

Sponsored by
HostEurope Logo

mksh tag cloud

All 1 2 3 4 5 6 7 8

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?

mksh improvements

22.03.2009 by tg@
Tags: mksh

Today's commits should fix Debian #518359 (not tried yet, as looking at a 14" Belinea 10 40 40 CRT makes my eyes and head hurt), as well as improve a lot of more things.

The mksh(1) echo builtin now behaves more POSIXly in "set -o posix" mode (or when called as "sh", if that feature was set at compile time). The exact feature set is negotiable, if certain parties, say pkgsrc®, are interested.

Thanks to the OpenBSD developers for improving their ksh as well.

The ;& and ;;& features are delayed for now though, sorry.

We're in a feature freeze; people please test mksh-current on your system to make R37 rock!

The MirOS Project News in the upcoming February issue of the BSD magazine contains a mention of mksh R37 with a new memory allocator. This will, however, be postponed, because I could not get it right in time (even though I learned from the first tries – and wish I could write it in i386 assembly) and lost interest for now, as the current one still does work. I may revisit that at a later date.

Fixing the PS1 bug, maybe changing the echo builtin to SUSv3 (and nothing more), maybe porting, are on the list, besides continuing the Coverity Scan fixes.

more bugs – bootloader and mksh

01.02.2009 by tg@
Tags: bug event grml mksh snapshot

Again. I almost have a MirGRML+bsd4grml ISO ready (exactly 72 MiB), just for the fun of it, and so that people can toy with it – and test the integration. But nooo, I even hacked a disklabel, yet it wouldn’t access the filesystem. The “machine label” command shows what’s wrong (and hints how to fix it), and I missed a corner case in disc I/O due to adding two not-so-independent-from-each-other scenarios during the El Torito merge.

mksh has funny behaviour with ${foo/@(%)/x} failing – only in Unicode mode though.

more bootloaders *grml*

31.01.2009 by tg@
Tags: bug event mksh snapshot unicode

To counter the bug in Parallels Desktop, I rewrote all of our Master Boot Record (mbrldr, mbrmgr), Partition Boot Record (bootxx), and BIOS disc detection code in boot(8/i386). I've also changed the magics, API etc. a little between these, rewriting or removing quite some parts of both installboot(8/i386) and bootxx.sh a.k.a. self-installing bootblocks. Oh, and MBR and PBR are smaller, or rather, have more room for informatory texts and data block storage now.

Lucas “laffer1” Holt from that cat's BSD helped me testing, qemu and bare metal IBM X40 works, so I suppose it's good. Can't test on VMware Server 2 right now.

On the other front, I'm writing this wlog entry on MirGRML, which is finally sort-of finished (which is why it has much less Unicode than a regular posting from my laptop). lynx-cur in sid is broken though, due to it using GnuTLS. Gah! Anyway, I see a sid “wtf” repo coming, and it was workarounded; next time I'll just do things differently.

Lukas “smultron” , the graphician of our partner project mnbsd, helped a little with the label (while I'm not versed in that field, if I had gotten the right material to work with I could've managed it all alone this time), and all that's left now is the Live-CD part and baking (and testing! even on sparc...) the ISO 9660 image.

There will be 297 MirBSD Triforce™ DuaLive™-CDs (two will go to Kiwi land to swishy, one is already reserved for XTaran) and 50 MidnightBSD Live DVDs at FOSDEM.

gecko2@ and bsiegert@ were not too helpful today, although I have to admit that real life often has precedence. I merely read some and went to sleep early yesterday too (and disabled both POTS and cell phone so that I couldn't be waked, haha!) instead of hacking late. Luckily, the deadline is not that dead, and I'll almost certainly make it tomorrow, in time. Thanks again, Daniel Seuffert from AllBSD.de, for all support you and others give to the smaller BSDs. Heh, and laffer1 is not quite done yet with his ISO (or UDF?) either.

positive feedback

15.01.2009 by tg@
Tags: mksh

iMil of Beastiebox has apparently lauded me for mksh – someone came into our IRC channel #!/bin/mksh by means of it. Thanks, it is not often that people give feedback on things. According to them, code quality is very good. While many things are inherited this shows that the cleanup both OpenBSD and I did did pay off.

Tonnerre thanked for a script of mine he put to good production use: svn2cvs, which I already talked about. Glad to be helpful!

Sadly, at work we’d probably need cvs2svn. Not going to do. Besides, it won’t work that easily – their CVS doesn’t use commit IDs, and svn has no tools like rcs(1), ci(1), co(1) which are immensely useful.

New allegiances for mksh & Co.

08.01.2009 by tg@
Tags: grml mksh snapshot

mksh formed new allegiances: the Beastiebox Project (10x hubertf@TNF for mentioning) has added mksh(1) today, and the latest project of CcSsNET, CcSsLIVE (broken link removed 20100916), will include it soonish as well. Nicely, he already links to MirBSD, for he sits in our IRC channel usually and is one of the sparc users.

The next version of grml GNU/Linux might very well come not just with mksh(1) (except grml-small), but also with bootbsd.com née boot(8/i386) and bsd.rd (a slightly “tuned” version with added e3 editor and sans the Install/Upgrade/Shell prompt). On the contrary, I’m toying with the idea of adding a ports/sysutils/pxegrub for local boot along with a slightly tuned (add mksh at the very least) on the DuaLive ISOs if I find we have the space. We’ll have to work out something, licence and GPL-source-requirement wise, but we’re positive this would work out well. Considering just how good of a rescue system our bsd.rd kernel is, already, and what added benefit a minimal pretty standard Live Linux may provide.

Best bash tip ever! Use mksh!

31.12.2008 by tg@
Tags: mksh

Best Bash tip ever! is a little… interesting. Of course, mksh(1) can do it as well:

tg@bleu:~ $ head -2 /var/run/dmesg.boot
MirBSD#10uA4 (GENERIC) #1161: Fri Dec 26 21:05:59 UTC 2008
        tg@bleu.mirbsd.org:/usr/src/distrib/generic/obj/build/GENERIC
tg@bleu:~ $ r 2=3
head -3 /var/run/dmesg.boot
MirBSD#10uA4 (GENERIC) #1161: Fri Dec 26 21:05:59 UTC 2008
        tg@bleu.mirbsd.org:/usr/src/distrib/generic/obj/build/GENERIC
cpu0: Intel(R) Pentium(R) M processor 1.40GHz ("GenuineIntel" 686-class) 598 MHz
tg@bleu:~ $ fc -l
1       head -2 /var/run/dmesg.boot
2       head -3 /var/run/dmesg.boot

What’s best, the modified commands are written into the history, not the modificator itself.

Some of the commentaries are rather clueless too, not $! but $_ is the last word of the last command, in this case:

tg@bleu:~ $ head -2 /var/run/dmesg.boot
MirBSD#10uA4 (GENERIC) #1161: Fri Dec 26 21:05:59 UTC 2008
        tg@bleu.mirbsd.org:/usr/src/distrib/generic/obj/build/GENERIC
tg@bleu:~ $ print $_
/var/run/dmesg.boot

Instead of “^-s” you would use “r -- -s=” (the two dashes are needed as the “r” built-in alias parses its arguments).


More on Planet Debian (read via Planet Symlink): how many times do I have to tell you it’s “CAs” not “CA’s” again? Please do the world a favour and read Apostrophen und andere Katastrophen with rules for German and English: never in German except the word ends with s or similar: „Jens’, Max’ und Joes CDs“ and for genitives only in both languages, but with apostrophe in English: “Jens’, Max’ and Joe’s CDs”

ciruZ now has a blog too… with two ruby scripts. I prefer mine in mksh very much, thank you :þ

An mksh-current cygwin snapshot I just built for smultron, our graphical artist friend from MidnightBSD (which, by the way, also packages mksh(1)). He just did this:

mksh Logo

We’ll see what we do with that “m”…

All 1 2 3 4 5 6 7 8

MirOS Logo