7.2. Call Only Interfaces Intended for Programmers

Call only application programming interfaces (APIs) that are intended for use by programs. Usually a program can invoke any other program, including those that are really designed for human interaction. However, it's usually unwise to invoke a program intended for human interaction in the same way a human would. The problem is that programs's human interfaces are intentionally rich in functionality and are often difficult to completely control. Usually the same program can be invoked As discussed in Section 7.1, interactive programs often have ``escape'' codes; programs shouldn't usually just call mail, mailx, ed, vi, and emacs, at least not without checking their input. Usually there are parameters to give you safer access to the program's functionality, or a different API or application that's intended for use by programs. Use those instead. For example, instead of an editor (like ed, vi, or emacs), use sed where you can.