
私が見たとき、man bash
これらのどれも定義されていませんでした。しかし、オンラインでランダムに言及された投稿はどこから来たのですか?それとも単なるコンベンションですか?
答え1
彼らは他のものと同様に慣習にすぎません。標準ではあまりにも広く使用されているので、使用は賢明ではない衝突する変数に属すると言われていますEDITOR
。PAGER
バラより第8章 第1節:
広く使用されているコマンドソルバーやアプリケーションで頻繁にエクスポートされる特定の変数と競合するのは賢明ではありません。
... EDITOR ... PAGER ... VISUAL ...
様々なプログラムは、これらの様々な組み合わせを尊重します。
man 1 crontab
(POSIX):
The following environment variables shall affect the execution of
crontab:
EDITOR Determine the editor to be invoked when the -e option is
specified. The default editor shall be vi.
2. The editor specified by the policy is run to edit the
temporary files. The sudoers policy uses the
SUDO_EDITOR, VISUAL and EDITOR environment variables (in
that order). If none of SUDO_EDITOR, VISUAL or EDITOR
are set, the first program listed in the editor
sudoers(5) option is used.
man 1 man
(POSIX):
ENVIRONMENT VARIABLES
The following environment variables shall affect the execution of man:
...
PAGER Determine an output filtering command for writing the output to
a terminal. Any string acceptable as a command_string operand to
the sh -c command shall be valid. When standard output is a
terminal device, the reference page output shall be piped
through the command. If the PAGER variable is null or not set,
the command shall be either more or another paginator utility
documented in the system documentation.
マニュアルに記載されていないのは驚くべきことではありませんbash
。なぜなら、私が考えることができるbash組み込み機能のどれも使用できないからです。しかし、彼らは他のユーティリティで広く使用されています。これら3つはただ私一般的に使用されます。
この変数BROWSER
はまたは同じレベルにありません。この変数は標準に言及されていません。ただし、次の一部のプログラムではこれを使用できます。EDITOR
PAGER
man
man 1 man
(Debian):
BROWSER
If $BROWSER is set, its value is a colon-delimited list of com-
mands, each of which in turn is used to try to start a web
browser for man --html. In each command, %s is replaced by a
filename containing the HTML output from groff, %% is replaced
by a single percent sign (%), and %c is replaced by a colon (:).
答え2
この慣行は私が覚えている限り30年以上続いてきました。
これBSD 4.2 メールのマニュアルページ1983年4月1日に言及されたEDITOR
、、、SHELL
。VISUAL
PAGER
「man」のBSD 4.2バージョンは、以下を言及していません:
標準出力がテレタイプであるか - フラグが与えられると、 man は出力を cat(1) 経由で送信します。
しかし、1990年頃4.3リノに登場した。