Путеводитель по Руководству Linux

  User  |  Syst  |  Libr  |  Device  |  Files  |  Other  |  Admin  |  Head  |



   more.1p    ( 1 )

постраничная основа (by-page basis)

Обоснование (Rationale)

The more utility, available in BSD and BSD-derived systems, was chosen as the prototype for the POSIX file display program since it is more widely available than either the public-domain program less or than pg, a pager provided in System V. The 4.4 BSD more is the model for the features selected; it is almost fully upwards-compatible from the 4.3 BSD version in wide use and has become more amenable for vi users. Several features originally derived from various file editors, found in both less and pg, have been added to this volume of POSIX.1‐2017 as they have proved extremely popular with users.

There are inconsistencies between more and vi that result from historical practice. For example, the single-character commands h, f, b, and <space> are screen movers in more, but cursor movers in vi. These inconsistencies were maintained because the cursor movements are not applicable to more and the powerful functionality achieved without the use of the control key justifies the differences.

The tags interface has been included in a program that is not a text editor because it promotes another degree of consistent operation with vi. It is conceivable that the paging environment of more would be superior for browsing source code files in some circumstances.

The operating mode referred to for block-mode terminals effectively adds a <newline> to each Synopsis line that currently has none. So, for example, d<newline> would page one screenful. The mode could be triggered by a command line option, environment variable, or some other method. The details are not imposed by this volume of POSIX.1‐2017 because there are so few systems known to support such terminals. Nevertheless, it was considered that all systems should be able to support more given the exception cited for this small community of terminals because, in comparison to vi, the cursor movements are few and the command set relatively amenable to the optional <newline> characters.

Some versions of more provide a shell escaping mechanism similar to the ex ! command. The standard developers did not consider that this was necessary in a paginator, particularly given the wide acceptance of multiple window terminals and job control features. (They chose to retain such features in the editors and mailx because the shell interaction also gives an opportunity to modify the editing buffer, which is not applicable to more.)

The -p (position) option replaces the + command because of the Utility Syntax Guidelines. The +command option is no longer specified by POSIX.1‐2008 but may be present in some implementations. In early proposals, it took a pattern argument, but historical less provided the more general facility of a command. It would have been desirable to use the same -c as ex and vi, but the letter was already in use.

The text stating ``from a non-rewindable stream ... implementations may limit the amount of backwards motion supported'' would allow an implementation that permitted no backwards motion beyond text already on the screen. It was not possible to require a minimum amount of backwards motion that would be effective for all conceivable device types. The implementation should allow the user to back up as far as possible, within device and reasonable memory allocation constraints.

Historically, non-printable characters were displayed using the ARPA standard mappings, which are as follows:

1. Printable characters are left alone.

2. Control characters less than \177 are represented as followed by the character offset from the '@' character in the ASCII map; for example, \007 is represented as 'G'.

3. \177 is represented as followed by '?'.

The display of characters having their eighth bit set was less standard. Existing implementations use hex (0x00), octal (\000), and a meta-bit display. (The latter displayed characters with their eighth bit set as the two characters "M-", followed by the seven-bit display as described previously.) The latter probably has the best claim to historical practice because it was used with the -v option of 4 BSD and 4 BSD-derived versions of the cat utility since 1980.

No specific display format is required by POSIX.1‐2008. Implementations are encouraged to conform to historic practice in the absence of any strong reason to diverge.