Is `command -v` option required in a POSIX shell? Is posh compliant with POSIX?

前端 未结 2 1004
青春惊慌失措
青春惊慌失措 2021-01-18 18:28

I am using posh to test my shell script that I want to run successfully on any POSIX compliant shell. While doing so, I found that the command -v option is not

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-18 19:00

    See the [UP] margin code next to the definition of -v. Per the list of margin code notations (emphasis added):

    [UP] User Portability

    The functionality described is optional.

    Where applicable, utilities are marked with the UP margin legend in the SYNOPSIS section. Where additional semantics apply to a utility, the material is identified by use of the UP margin legend.

    Thus, it's black-letter POSIX: This functionality is optional.

提交回复
热议问题