bug-ed
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ed -p '' errors, but shouldn't


From: Antonio Diaz Diaz
Subject: Re: ed -p '' errors, but shouldn't
Date: Sat, 08 Jun 2024 19:33:23 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14

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

[Prev in Thread] Current Thread [Next in Thread]