[comp.unix.shell] Why does more

rouben@math9.math.umbc.edu (11/29/90)

On a couple of different systems I have tried, more(1) always exits
with status 0.  I would have expected more(1) to exit with a not-zero
status when invoked with a non-existent file as its standin.

Both cat(1) and tail(1) exit with status 1 when trying to open a 
non-existent file.  Why not more(1)?

Is this due to an oversight or due to a conscious decision?  Does 
anyone know?

--
Rouben Rostamian                            Telephone: (301) 455-2458
Department of Mathematics and Statistics    e-mail:
University of Maryland Baltimore County     bitnet: rostamian@umbc
Baltimore, MD 21228,  U.S.A.                internet: rostamian@umbc3.umbc.edu

flee@guardian.cs.psu.edu (Felix Lee) (11/29/90)

If more(1) or less(1) were to produce a different exit status for each
different type of exit action, you could build intelligent wrappers
around your pager.
  0 - normal exit (falling off the bottom)
  1 - quit (q)
  2 - next file (:n)
  3 - previous file (:p)
(and various error exits)

And then something like "zmore" would be able to deal with multiple
files properly.  And you might rewrite "rn" to allow using an external
pager, rather than its baroque internal version.
--
Felix Lee	flee@cs.psu.edu