Live data from Hacker News

More, less, and a story of typical Unix fossilization

utcc.utoronto.ca

31–40 of 127 posts

Re: More, less, and a story of typical Unix fossilization

#31

Earlier quoted context omitted.

I dunno, I'm a long term *NIX person (Solaris 1994-2011, Linux on and off 1994-2006, Linux mostly 2006-now) I am now involved in more Powershell scripting on Windows than I have ever done before. I don't see - Get-Content -Tail 10 FILE as an improvement on - tail -10 FILE I think when it comes to the combination of intuitive command names and terseness when required, VMS' DCL is still unsurpassed. Having commands wit…

To me, the main advantage of Powershell is filename handling. I know that if I do everything just right, then my scripts will handle filenames with spaces/newlines/other crazy characters, but I always mess up somehow. Nowadays if I ever want a script I'll distribute to people who might have spaces in directories, I write it in python even if it would be a 4 line bash script, just to avoid the issue.

I've never really had a problem with spaces in path names.

You should be quoting variables when they're used though, there is a shell style guide put out by google that deals with this stuff.

https://google.github.io/styleguide/shell.xml?showone=Quotin...

Re: More, less, and a story of typical Unix fossilization

#32
post #7

There is another pager, less advanced than more http://www.unix.com/man-page/linux/1/pg/

There's "most" pager discussed here a week or so ago, too. (Incidentally that link returns a blank page for me on FF mobile.)

I missed most, I'll look for it.

The link to pg works on my FF Android. I'm using uBlock origin. Are you using some other adblocker or add on?

Re: More, less, and a story of typical Unix fossilization

#33
post #9

I can see the fossilization, but I don't see what's so typical Unix of that phenomenon. Windows still includes cmd.exe with all its broken, retarded features, while it has powershell, which is supposedly (no experience myself) a little less retarded.

cmd.exe starts in a second, powershell takes 5 and then another 10 to actually be interactive. So it's still useful to me.

This was exactly my reason for ignoring powershell for a long time. Just tested it and it seems to start much quicker now.

Re: More, less, and a story of typical Unix fossilization

#34
On thing the article misses on is that, at least in Linux, less is not a line by line pager, it controls the whole terminal screen area, so for example if you pipe output to a file that has terminal instructions (bold, color, cursor moves etc) and try to use less to read the file it will not give such good output. More just outputs the ctrl chars and lets the terminal emulator deal with them, so they are visible, Thus highlighting the benefit of simplicity over cruft.

Sometimes, because more does less, more > less.

Re: More, less, and a story of typical Unix fossilization

#36

On thing the article misses on is that, at least in Linux, less is not a line by line pager, it controls the whole terminal screen area, so for example if you pipe output to a file that has terminal instructions (bold, color, cursor moves etc) and try to use less to read the file it will not give such good output. More just outputs the ctrl chars and lets the terminal emulator deal with them, so they are visible, Thu…

The "-r" option to less will allow the "raw" control characters to pass through. "less -r" will do what you want.

Re: More, less, and a story of typical Unix fossilization

#37
post #21

> In a sane world, Unix vendors would have either replaced their version of more with the clearly superior less But that's just the thing - 'less' isn't "clearly superior" to 'more'. It is (or was, maybe this has changed) heavier weight and offers more functionality that may not be needed. Having both commands lets script writers use exactly the tool they need for the job. And it's not like the extra 35KB of keeping…

The problem isn't the 35k, the problem is now we all have to spend a little bit of extra brain capacity, remembering the difference between 'more' and 'less', and how while you would imagine 'more' is better (based on the traditional English meaning of the words), actually, 'more' is the lesser product. I wonder how many hours have been wasted altogether on people learning, and misunderstanding, which of more or less…

Plus, `more` as a pager command at least makes a tiny bit of sense, but `less` is a ridiculously obscure command name for beginners.

Re: More, less, and a story of typical Unix fossilization

#38
post #15

I've used Linux for a decade-and-a-half, but I've never totally loved the shell, because of the need to learn this sort of pointless arcana. PowerShell was a massive step forward, and I had hoped that an Open Source, cross-platform equivalent would develop so that we could get past the current local maxima of 1970s-era design. It's rather weird that the Open Source equivalent of PowerShell is now...PowerShell. Even i…

doing simple "df" "du" "find -exec" it still complex/verbose TODAY using powershell , I find disgusting that you compare bash to powershell (I'm not even talking about speed)

Re: More, less, and a story of typical Unix fossilization

#39
post #15

I've used Linux for a decade-and-a-half, but I've never totally loved the shell, because of the need to learn this sort of pointless arcana. PowerShell was a massive step forward, and I had hoped that an Open Source, cross-platform equivalent would develop so that we could get past the current local maxima of 1970s-era design. It's rather weird that the Open Source equivalent of PowerShell is now...PowerShell. Even i…

doing simple "df" "du" "find -exec" it still complex/verbose TODAY using powershell , I find disgusting that you compare bash to powershell (I'm not even talking about speed)

even tho the commands mentioned above aren't bash built-ins

Re: More, less, and a story of typical Unix fossilization

#40
post #3

Now all we need is someone to modify less to recognize that its standard in is connected the output of more so that if you type `cat /etc/passwd | more | less` it could output something which, more or less, looked like the input.

The problem is less that we have fossilization and pointless cruft around basic utilities, it's more that the replacements are written by people with a sense of humor, and their sense of humor is distinctly punny.
Post reply on HN