On Thu, Jun 06, 2024 at 09:39:45PM -0500, jack...@fastmail.com wrote:
> The actual arguments that the ed executable sees in its "main(argc,argv)" 
> argument list depend on how you shell parses the command you typed at your 
> prompt and then composes the resulting exec system call.
> 
> I'm not seeing the same problems you're seeing ... my shell happens to parse 
> these command strings as you (and I) expect.
> 
> Perhaps the following will help dissect this issue.  What does the following 
> output, when typed as a command at your shell's prompt:
> 
> for i in ed -p '' foo.txt; do echo A"${i}"B; done
> 
> (Were the first '' is a pair of single quotes, and the other two " are each a 
> double quote.)
> 
> I get this output:
> 
> AedB
> A-pB
> AB
> Afoo.txtB
> 
> -- 
> Paul Jackson
>   jack...@fastmail.fm
> 

I don't understand why you are bringing up all this nonsense.

Please, you, make sure that you are actually using GNU ed, and specify
what version you are using.
(You have not shown a single ed command being run in your email... did
you even try to reproduce the bug that was reported?)

I have tried both 1.20.2 on my PC and 1.10 on another system, and I have
pointed out the code that is causing the problem.

Here is the output of your shell command (literally what other output
would you expect?):

    $ for i in ed -p '' foo.txt; do echo A"${i}"B; done
    AedB
    A-pB
    AB
    Afoo.txtB

Here is the execve linux syscall that starts GNU ed as logged by strace:

    $ strace -qqqeexecve -bexecve ed -p ''
    execve("/usr/bin/ed", ["ed", "-p", ""], 0x7ffe2f049050 /* 56 vars */) = 0
    ed: option requires an argument -- 'p'
    Try 'ed --help' for more information.

I am so utterly baffled by your email, that I can only assume you are
trolling.

o/
 emanuele6

Reply via email to