help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Most used words in current buffer


From: Nick Dokos
Subject: Re: Most used words in current buffer
Date: Thu, 19 Jul 2018 13:19:39 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Bob Proulx <bob@proulx.com> writes:

>
> I am in total agreement over using sed instead of head if you want to
> do that.  Seeing 'sed 20q' should roll off the keyboard as print lines
> until line 20 and then quit.  Very simple and to the point.  There is
> definitely no need for a separate head command.  Other than for
> symmetry with tail which is not as simple in sed.
>

IIRC, Kernighan & Pike say in the "Unix Programming Environment" that
there *was* a `head' program, in addition to the `tail' program. It
fell into disuse and disappeared almost immediately after sed became
available. tail is still around, I guess both because the sed
invocation for `tail -n' does not quite roll off the fingers the same
way that 20q does -- see e.g

   https://unix.stackexchange.com/questions/107387/emulate-tail-with-sed#107388
  
-- but also because `tail -f' cannot be emulated by sed, at least not
without a lot of effort and/or another program).

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




reply via email to

[Prev in Thread] Current Thread [Next in Thread]