bug-bash
[Top][All Lists]
Advanced

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

Re: About `M-C-e` expand result `'` failed


From: Zachary Santer
Subject: Re: About `M-C-e` expand result `'` failed
Date: Tue, 30 Jan 2024 06:48:24 -0500

Even if this doesn't happen, you still don't end up with the command line
you probably wanted.

$ echo "$(echo $'ab\ncd\nef')" # enter
ab
cd
ef
$ echo "$(echo $'ab\ncd\nef')" # input M-C-e
$ echo ab
cd
ef # enter
ab
-bash: ef: command not found

And yes, that did change my working directory to my home directory.

Would it be unreasonable to expect that the argument to the outermost echo
after M-C-e still be in double-quotes? Or potentially placed in
single-quotes. That way, the line would be evaluated the same way as it
would've been without M-C-e.

Compare:

$ echo $(echo $'ab\ncd\nef') # enter
ab cd ef
$ echo $(echo $'ab\ncd\nef')  # input M-C-e
$ echo ab cd ef # enter
ab cd ef

which was kind of surprising but arguably correct.


reply via email to

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