Le 12/08/2021 à 16:29, Chet Ramey a écrit :
On 8/11/21 6:35 PM, Jean-Jacques Brucker wrote:
Thank a lot Chet.
I still think it would have been more consistent to extend the $'...'
syntax.
Why would it be more consistent to add translation to a quoting syntax
that
didn't have it than to post-process translations in a different way?
Chet
I'm probably less familiar with the history of shells and bash than you
(and
others on this mailing list), but it seems to me that:
First were the chains:
* '...' who did not expand anything
* "..." which expanded the syntaxes $VAR and the unfortunate `...` [1]
Then the syntax $"..." was introduced, then the syntax $'...' (bash 2.X).
As the character '$' means "interprets (synonym: translates) what
follows", it
seems to me quite consistent that $"..." means "translates the entire
following
string"
Conversely, the syntax $'...' seems to me much less consistent.
(Reminder: C is
prior to shells, and bash is itself written in C).
However, the "C-string" feature is very useful (and nowadays probably
more used
than the translation feature).
In absolute terms, if one day we would list all the historical design
errors,
dare to break some compatibilities, and manage to establish new shell
standards
(I'm probably dreaming ... but do we ever know ?). Then we could have: