Comment 2SY2 Re: mksh workalike

Story

Vulnerability in Bash Shell widespread and serious

Preview

mksh workalike (Score: 2, Interesting)

by evilviper@pipedot.org on 2014-09-25 11:44 (#2SX5)

If you don't need quite all the bash-isms, mksh is a great lightweight replacement, which is almost entirely drop-in compatible:

* http://mirbsd.de/mksh

I prefer mksh primarily because bash goes horribly brain-dead when you attempt line-editing on command lines that wrap-around to the next line. Your bash session becomes practically unusable after you hit that limit (which I do, often) and it first wigs-out:

* http://i.imgur.com/Vo2BQq2.png

It doesn't hurt that the mksh binary is 3.4X smaller, starts-up faster, is more responsive, can be statically linked, and doesn't hold open 28 files, all of which matters a lot in a minimal system recovery type situation.

Re: mksh workalike (Score: 5, Informative)

by eliphas@pipedot.org on 2014-09-25 12:52 (#2SXF)

[...]because bash goes horribly brain-dead when you attempt line-editing on command lines that wrap-around to the next line. Your bash session becomes practically unusable after you hit that limit (which I do, often)[...]
Hate that too. But for you guys that happen to know/use vi (who doesn't :D) navigation with HJKL and commands, like:
3w - to go to third word from current position
dw - to delete word
c4f. - to replace all text from current position to the fourth ". dot" character (try that with other editing mode!), etc...

Put "set editing-mode vi" in /etc/inputrc (a lot of CLI programs use readline and will read that) or "set -o vi" for your current bash shell or bashrc.
VI mode on command line is a bliss, and "set -o vi" is the first thing I put on my .rc files where I first login on a new server. Bummer that some minimalistic shells like busybox's (only sh there) do not have that :(

Re: mksh workalike (Score: 2)

by seriously@pipedot.org on 2014-09-25 15:14 (#2SXM)

Oh my ... d$, yw, p, u, it all works !! that's insane (as in vi: press "ESC" and "i" to switch modes)

I never even had heard of that and I've been using it for years. I owe you a beer and probably some new hours of life expectancy too :-)

edit: ... "edit" ? is that an awesome new feature of pipedot for logged-in users?

Re: mksh workalike (Score: 2, Informative)

by evilviper@pipedot.org on 2014-09-25 22:05 (#2SY2)

FYI, editing works more like deleting your comment... It will revert any moderation your comment has gotten, and your comment will show up highlighted like it is a "new" comment in the discussion.

Moderation

Time Reason Points Voter
2014-09-26 01:23 Informative +1 eliphas@pipedot.org

Junk Status

Not marked as junk