[Toybox] [PATCH] optional fatter cat(1)
Rob Landley
rob at landley.net
Sat Jan 3 23:39:21 PST 2015
On 01/03/2015 10:07 PM, Rich Felker wrote:
> On Thu, Jan 01, 2015 at 10:41:22PM -0600, Rob Landley wrote:
>> On 01/01/2015 01:04 PM, dmccunney wrote:
>>> On Thu, Jan 1, 2015 at 1:39 AM, David Seikel <onefang at gmail.com> wrote:
>>>
>>>> I have a simple test to decide if I like an editor as a result of these
>>>> decades of random editor usage. If I can't sit down with the editor
>>>> and figure out how to do basic editing and saving in less than a
>>>> minute (sans documentation), then in my opinion it's a crap editor.
>>>> Both TECO and vi fail this test miserably, though oddly enough I have a
>>>> soft spot for TECO.
>>>
>>> These days, the general assumption is that you can open a file in an
>>> editor with "<editor> <filename>", and that once up, cursor keys can
>>> be used to move around in the file and that text can be added where
>>> desired by typing it at the cursor location and deleted with Backspace
>>> or Delete keys.
>>>
>>> Vi originated in the days when some of those assumptions might not be
>>> true. Some early terminals on Unix systems didn't *have* cursor keys
>>> or F-keys. The vi command set and separation between input and
>>> command modes was a result.
>>
>> Indeed.
>>
>> However, ubuntu's decision to only allow you to cursor around in insert
>> mode when you call "vim" and to _disable_ that when you call it as "vi"
>> (so the cursor keys instead crap B[ and such all over your text) is
>> insane and stupid. And the fix is to delete /etc/vim/vimrc.tiny and make
>> it a symlink to just "vimrc" in the same directory. And the fact you
>> _need_ to do that on each new ubuntu install is just one more way that
>> Mark Shuttleworth is trying to cram his personal preferences down
>> people's throats.
>
> Yes this is idiotic.
>
>> (Redirecting /bin/sh to point to dash instead of bash was still a dumber
>> move, though.)
>
> I fail to see how this was dumb. It made shellshock a non-issue
When they switched to dash I _segfaulted_ the thing multiple times. It
was a buggy pile of crap for _years_.
It's interesting you think shellshock was a non-issue, presumably that's
why it didn't make the news or anything? (I'm consistently amused that
ESR wrote The Cathedral and the Bazaar pointing out that the Linux
Bazaar worked better than the FSF's Cathedral and then people assumed
that "free software" codebases benefitted the same way from "open
source" codebases despite the giant cultural gap. The variable export
bug was 20 years old when it was found. FSF code does not get reviewed.
OpenSSL did not get reviewed either. Contributions from outsiders were
not welcome, but everybody got complacent because _other_ pieces of open
source software were being thoroughly reviewed...)
> and massively reduced the memory requirements (and probably increased the
> speed) of portable shell scripts.
Linus Torvalds implemented unix system calls in his 386 assembly
terminal program so it would run bash. Specifically, the program bash.
(It's in "Just For Fun and early interviews".) This means bash was the
standard shell in Linux _before_ 0.0.1, and continued to be right up
until ubuntu suddenly changed it.
When ubuntu made the change, among other things it broke the kernel
build. Linux _itself_ wasn't saying #!/bin/bash (or running with a
non-bash #!/bin/sh), and nobody had ever actually _noticed_ before
shuttleworth decided he knew better because nobody was doing that.
That's how ubiquitous this was on Linux.
Portable linux shell scripts back then meant portable between
distributions, and bash was one of the few things linux distributions
agreed on. To the point LSB 1.2 (in 2002) had a page that boiled down to
"yeah, everybody actualy uses bash but we're trying to be a standards
document here":
http://refspecs.linuxfoundation.org/LSB_1.2.0/gLSB/stdshellrat.html
There were unix scripts ported from other operating systems, but linux
had always had bash as its default shell on all distributions up until
shuttleworth decided to change that. (If somebody like Jorg Schilling
was forced to use a linux box he'd change #!/bin/sh as part of his
personal customization while waiting for the cyanide to kick in, but it
was one of the few things all the linux distros agreed on.)
> Bash-specific scripts should always
> be using #!/bin/bash.
If his goal had been "we should be more standard", that would have been
one thing. But that explicitly _wasn't_ his goal. The part that makes
this not just epic hubris but REALLY POOR JUDGEMENT is that his stated
reasons for doing it were a goal it clearly failed to achieve:
https://wiki.ubuntu.com/DashAsBinSh
I.E. "Init scripts are too slow, but having the init scripts to say
#!/bin/dash is too hard, so let's change the global symlink that's been
consistent across distros for 20 years, that won't cause any problems!"
(And see how the above link said "the default login shell remains bash",
so it was never about _simplifying_ anything. Instead of removing code
from the system they adding a second shell in parallel so some stuff was
done with one and some with another, and made the system depend on BOTH
of them. This was not laudable, this was insane.)
I repeat: their explicit _reason_ for redirecting the #!/bin/sh symlink
because changing the individual init scripts to say #!/bin/dash was
considered too big and intrusive a change.
No really.
And then since this didn't accomplish its stated purpose (boots were
still too slow and single threaded with lots of blocking waits,
especially since they kept adding more crap to their boot scripts rather
than simplifying them), they implemented upstart thus rendering the
switch more or less moot for its original purpose, and never REVERTED
the /bin/sh change because that would have been admitting they made a
mistake.
THAT is why this is a sign that Ubuntu's technical judgement is on the
far side of questionable. (Even before attempting to do Unity and
Upstart and Mir and their pay cloud storage thing and their music
service and sending all your desktop searches to <strike>the
NSA</strike> amazon all at the same time.)
And that's without getting into dash itself's "not ready for prime time"
nature when they made the switch:
http://landley.net/notes-2007.html#17-11-2007
http://landley.net/notes-2007.html#22-10-2007
http://landley.net/notes-2007.html#08-05-2007
Heh, I forgot that when you forked a background process with & and then
hit ctrl-c, dash would kill the background process:
http://landley.net/notes-2007.html#21-03-2007
http://landley.net/notes-2007.html#18-03-2007
and so on...
Really, I feel strongly about this one. Ubuntu can screw up at a
technical level, and that was a big one. The scope of the change they
made and the results they expected to get out of it were utterly
disproportionate, and as a distro they crammed a lot of pain down their
users throats for no actual benefit.
Rob
More information about the Toybox
mailing list