bug-ed
[Top][All Lists]
Advanced

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

Re: Escaped percent sign in shell escape (bang) command (ed 1.16)


From: Antonio Diaz Diaz
Subject: Re: Escaped percent sign in shell escape (bang) command (ed 1.16)
Date: Tue, 13 Jul 2021 15:58:59 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14

Hello,

Martin Thomsen wrote:
Using GNU bash 5.0.17(1) and GNU ed version 1.16 the command

printf '%s\n' 'r !date +"% modified on \%F"' ',p' Q | ed -s fil1

outputs

date +"fil1 modified on \%F"
fil1 modified on \2021-07-10

I think the output should contain no backslashes, per POSIX
documentation. The GNU ed manual would benefit from clarification.

Maybe it would be nice if the output would contain no backslashes, but I see nothing in the POSIX documentation nor in the ed manual that forces ed to remove them. AFAIK, GNU ed has never removed the slash before the '%'.

If there is a consensus that ed should remove the backslash from an escaped '%', I'll happily implement it.


Best regards,
Antonio.



reply via email to

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