IEEE Standards Interpretations for IEEE Std 1003.2™-1992 IEEE Standard for Information Technology--Portable Operating System Interfaces (POSIX®)--Part 2: Shell and Utilities
Copyright © 1996 by the Institute of Electrical and Electronics Engineers, Inc. 3 Park Avenue New York, New York 10016-5997 USA All Rights Reserved.
Interpretations are issued to explain and clarify the intent of a standard and do not constitute an alteration to the original standard. In addition, interpretations are not intended to supply consulting information. Permission is hereby granted to download and print one copy of this document. Individuals seeking permission to reproduce and/or distribute this document in its entirety or portions of this document must contact the IEEE Standards Department for the appropriate license. Use of the information contained in this document is at your own risk.
IEEE Standards Department, Copyrights and Permissions, 445 Hoes Lane, Piscataway, New Jersey 08855-1331, USA
Interpretation Request #136
Topic: fc -l Relevant Sections: 5.12.4
Historical shells do not implement fc -l as described in IEEE Std 1003.2-1992 since they include the current "fc" call in the output. Was this change from historical behavior intentional ? On page 546, section 5.12.4, lines 2196-2197 specify that "if last is omitted, last shall default to the previous command when -l is specified". It's clear that "previous command" refers to the command immediately preceding the "fc" call from lines 2198-2200, as it would make no sense to edit only the fc call. Historical Korn Shell behavior with -l when last was not specified was to display everying including the current fc command (or whatever command caused fc to be invoked). This means that the description in the standard is not consistant with historical practice. In addition, with historical practice, the 16 commands included the current command so that only the 15 previous commands are displayed.
The standard is unclear on this issue, and as such no conformance distinction can be made between alternative implementations based on this. This is being referred to the sponsor. There is no clear definition of whether the previous command refers to the history before fc was entered or the history including the fc command. It also appears that in historic practice this definition varied depending on the options given.
Rationale for Interpretation