[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, 6 Feb 2024 18:54:48 -0500 |
On Tue, Feb 6, 2024 at 3:13 PM Chet Ramey <chet.ramey@case.edu> wrote:
> There are other places (e.g., ${var@Q} where bash chooses the most
> appropriate form of quoting. Why not here?
zsant@Zack2021HPPavilion MINGW64 ~
$ animal='dog'
zsant@Zack2021HPPavilion MINGW64 ~
$ action='chases the cat'
zsant@Zack2021HPPavilion MINGW64 ~
$ printf '%s\n' "${animal}" "${action}"
dog
chases the cat
zsant@Zack2021HPPavilion MINGW64 ~
$ printf %s\n dog chases the cat # Same command as above, but with M-C-e
dognchasesnthencatn
zsant@Zack2021HPPavilion MINGW64 ~
$ printf '%s\n' "${animal@Q}" "${action@Q}"
'dog'
'chases the cat'
When Bash is looking at a line like
$ printf %s\n dog chases the cat
where should it choose to add quotes?
Compare this scenario to a hypothetical readline command that transforms
the command line so as to show the results of expansions, but leaving
quoting in place and adding backslashes, such that the end result of
evaluating the transformed line is identical to what would've happened had
the line not been transformed.
I accept the argument that you can just undo the M-C-e operation, though.
- Re: About `M-C-e` expand result `'` failed, (continued)
- Re: About `M-C-e` expand result `'` failed, Koichi Murase, 2024/02/03
- Re: About `M-C-e` expand result `'` failed, Martin D Kealey, 2024/02/03
- Re: About `M-C-e` expand result `'` failed, Koichi Murase, 2024/02/04
- Re: About `M-C-e` expand result `'` failed, Martin D Kealey, 2024/02/04
- Re: About `M-C-e` expand result `'` failed, Chet Ramey, 2024/02/06
- Re: About `M-C-e` expand result `'` failed, Mike Jonkmans, 2024/02/06
- Re: About `M-C-e` expand result `'` failed, Chet Ramey, 2024/02/07
- Re: About `M-C-e` expand result `'` failed, Chet Ramey, 2024/02/06
- Re: About `M-C-e` expand result `'` failed, Zachary Santer, 2024/02/06
- Re: About `M-C-e` expand result `'` failed, Chet Ramey, 2024/02/06
- Re: About `M-C-e` expand result `'` failed,
Zachary Santer <=
Re: About `M-C-e` expand result `'` failed, Chet Ramey, 2024/02/06
Re: About `M-C-e` expand result `'` failed, Chet Ramey, 2024/02/03