Search code examples
syntax-errorlanguage-lawyerdocumentationmanpage

man page of fc builtin uses − rather than - for options


I know that BUILTIN commands don't have separate man pages, however I am curious about the following.

Upon executing man fc in the terminal I searched for -l to look for its description. However, there is no result.

The reason is that the man page for fc (and maybe other builtins?) uses (which corresponds to <−> 8722, Hex 2212, Oct 21022, Digr -2) rather than - for option (even if the actual way to use them is the latter, not the former).

Is this somehow intended?


Solution

  • fc is part of the POSIX Shell & Utilities, which means it is standardized for better portability. Its POSIX page has a description of the utility with all the portable options, all using the standard ASCII hyphen character (0x2d).

    Also, the Utility Conventions part of POSIX does mention:

    Guideline 4: All options should be preceded by the '-' delimiter character.

    In which - is the "standard" ASCII hyphen character (0x2D).

    So I'd say that the issue with the is purely due to aesthetic reasons (probably to make the hyphens more distinguishable/easier to read).