[Top][All Lists]

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

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

From: Andrew L. Moore
Subject: Escaped percent sign in shell escape (bang) command (ed 1.16)
Date: Fri, 7 Jan 2022 21:54:30 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1

| Martin Thomsen wrote:
|     printf '%s\n' 'r !date +"% modified on \%F"' ',p' Q | ed -s
| 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.

I agree. This is the correct behavior. In Antonio's defense, this was
broken in ed-0.2, which he inherited.

Handling of backslash escapes, in general, and in shell commands in
particular, is tricky. I feel that I got it right in my
implementation. Please check out: https://github.com/slewsys/ed

reply via email to

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