Hacker News new | ask | show | jobs
by dekhn 1703 days ago
In those days people mainly used ! expansion. https://en.wikipedia.org/wiki/C_shell#History. I know many people who are incredibly good at using ! expansion to edit previous commands ("change that command 5 lines ago to rm -rf this other folder") but it's a bit of a footgun.
2 comments

Depends how you use it.

If you just want to execute it then it is a footgun - using only the !command syntax.

If you use the !command:p syntax then you are just printing what command has been executed instead of invoking it.

Example.

    % uname
    FreeBSD
    
    % !uname
    uname
    FreeBSD
    
    % !uname:p
    uname
    
    %
Right, but the up arrow didn't get in their way, right? So why get mad?

I imagine that how it worked for them before is that the up arrow would move the cursor to the previous line into the output of the previous command, while feeding the arrow key escape sequences to the shell prompt as part of the command. IOW, a pretty useless and annoying key right? Why even press it? How did they notice readline?

from what I can tell he was looking hard for problems.

He also noticed that if you ran 9 "yes" commands on a 8 core machine, the CPU wasn't allocated in 8/9ths units (one process always got a lot less CPU). he was used to much more predictible CPU scheduler on multiprocessor systems (spoilt by TruCluster). Linux later adopted a better scheduler (fair share) so imho he was right on that one, even if "yes" is a terribly performance metric.

It seems the lesson here is that changing things out from under someone isn't a good look. What would have been the cost in not changing users' shells for them?
Everybody else has a worse shell.