[comp.sources.d] Pg vs. Less

flee@gondor.psu.edu (Felix Lee) (11/03/87)

In article <1957@killer.UUCP> elg@killer.UUCP (Eric Green) writes:
>"pg" is sorry compared to "less".

Pg is comparable to less.  Both let you go to an arbitrary point in a file.
Both let you page backwards (but less will use scroll-backwards, if your
terminal has it; pg doesn't).  Pg with the -n option will use cbreak mode,
like less, so you don't have to hit RETURN after every command.

Pg is better than less.  If you feed a pipeline to pg, pg will copy stdin to
a temporary file, so you can still go to an arbitrary point in your output.
Less is limited by internal buffering.  Pg also has a "save" command, so you
can pipe a command to pg and keep the results after seeing them.  Less
(version 73) has an -L option to "log" stdin, but you have to decide to save
stdin before you invoke less.

Less is better than pg.  Less lets you set marks in the style of vi.  Less
lets you change tabstops with the -x option.  Even better, you can change
options while you're in less:  just type "-x4" or "-x2" the next time you're
looking at a C program that indents 12 levels deep.  Pg has none of these
features.

Pg is licensed by AT&T.  Less is free.
--
Felix Lee	flee@gondor.psu.edu	{cbosgd,cmcl2}!psuvax1!gondor!flee

wcs@ho95e.ATT.COM (Bill.Stewart) (11/04/87)

In article <1957@killer.UUCP> elg@killer.UUCP (Eric Green) writes:
>"pg" is sorry compared to "less".

"pg" comes with System V.  "more" comes with 4.*BSD.
"less" is public domain, and doesn't come standard with either, last I
checked.  When you're having a religious war about whose computer is
better, it's fair to compare "pg" and "more"; it's not fair to compare
"less" with either one since it didn't come from either the
Government-funded BSD community or the commercial AT&T (NIH) community.
It came from an independent person who wanted the best features of both,
and didn't have to go through a large bureaucracy to add them.

pg has a few good feature more doesn't, and not as many bugs,
but it's not as friendly and I seldom use it.  Instead, I
alias more=less and usually get what I want.  You can too, since the
source comes free off the net.

allbery@ncoast.UUCP (Brandon Allbery) (11/08/87)

As quoted from <1831@ho95e.ATT.COM> by wcs@ho95e.ATT.COM (Bill.Stewart):
+---------------
| In article <1957@killer.UUCP> elg@killer.UUCP (Eric Green) writes:
| >"pg" is sorry compared to "less".
+---------------

I have already commented on this.  I just want to add one thing:

Everyone seems impressed that "less" will "scroll backward".  I found this so
obnoxious (and NOT because I was on a slow terminal!) that I went back to
using "more".  I plan on reimplementing "pg" in the public domain, fixing
a few things that I consider bugs (for example, it switches to -icanon mode
after displaying the prompt and switches back to icanon after getting the
command, which has, shall we say, "unpleasant" effects on typeahead).

On the other hand, "less" is perfect for people who enjoy "vi".  (I prefer
emacs, personally, but I don't get into religious wars about it because I
can understand how forbidding emacs can look to others.  Especially since
I'm now having to virtually relearn Emacs in order to un-learn Jove and learn
Gnu instead....)  It presents a user interface that is similar to vi without
its overhead.
-- 
Brandon S. Allbery		     necntc!ncoast!allbery@harvard.harvard.edu
 {harvard!necntc,well!hoptoad,sun!mandrill!hal,uunet!hnsurg3}!ncoast!allbery
Moderator of comp.sources.misc

charles@hpcvcd.HP (Charles Brown) (11/09/87)

> On the other hand, "less" is perfect for people who enjoy "vi".  (I prefer
> emacs, personally, but I don't get into religious wars about it because I
> can understand how forbidding emacs can look to others.  Especially since
>	Brandon S. Allbery     necntc!ncoast!allbery@harvard.harvard.edu

It turns out to be not too hard to put emacs bindings into less.  I did
this for an earlier version of less.  I have been too busy to do it
with the new version.
	Charles Brown	hplabs!hp-pcd!charles