New (and extremely trivial) code!
I salvaged an ancient Acer Aspire One (powered by an AMD C50 @ 1ghz; the thing had Windows 7 on it, but when I powered the thing on to check it out it spent about a hour slowly applying updates, then finding something had gone wrong and bailing on the whole shebang at the end. Sigh. I suspect something faster would have failed in less time!) and put Slackware 14 + kde onto the thing.
Kde is, at least in the context of Linux windowing environments, not totally awful, but it does have the extremely annoying feature of a terminal emulator (konsole) that doesn’t have a way to start shells as login shells (which has the plus of not doing utmp entries, but that’s counteracted by – at least in the case of ksh – having the shell not read /etc/profile
at startup.) Well, that won’t do.
So, the world’s most trivial New Code! – /sbin/loginsh
, which takes $SHELL
, picks out the basename, prefixes that with a -
, then execs $SHELL
with argv[0]
being the newly prefixed basename. No privilege escalation, no user interaction, just adding that damned -
so $SHELL
does the right thing, and by the right thing I mean acts like a login shell.
I’ve released it into the public domain, so you can do with it what you will. So try it out; it probably won’t eat your computer!