Hello Emanuele,

Emanuele Torre wrote:
I have noticed that  ed -p ''  errors with the following error.

Thank you for reporting this, and for your accurate diagnostic of the cause of the behavior of ed.

That seems incorrect; there does not seem to be anything in the
POSIX Issue 7 specification for ed that allows unspecified behaviour
when the prompt string is empty or requires that the prompt string
specified by -p shall not be the empty string.

Note that empty option-arguments are ambiguous. See item 2a of section '12.1 Utility Argument Syntax':

https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html#tag_12_01

"a. If the SYNOPSIS of a standard utility shows an option with a mandatory option-argument (as with [ -c option_argument] in the example), a conforming application shall use separate arguments for that option and its option-argument. However, a conforming implementation shall also permit applications to specify the option and option-argument in the same argument string without intervening <blank> characters."

How should ed interpret the following command line?:

  ed -p"" foo

Until the above ambiguity is solved (if it is even possible), I think ed's current behavior is the safest compromise.

Best regards,
Antonio.

Reply via email to