2017年10月6日金曜日

bcコマンドに行編集機能がある

最近になって、Unixシステムにあるbcという計算コマンドで、行編集や履歴操作ができることを教えてもらいました。しりませんでした。

手元のFreeBSD 11で試してみると、確かに使えます。manにも以下のように書かれています。
COMMAND LINE EDITING
bc supports interactive command line editing, via the editline(3)
library.  It is enabled by default if input is from a tty.  Previous
lines can be recalled and edited with the arrow keys, and other GNU
Emacs-style editing keys may be used as well.
 

The editline(3) library is configured with a .editrc file - refer to
editrc(5) for more information.
知りませんでした。