There is a nice feature in bash, about localization (language translation):
TEXTDOMAIN=coreutils
LANG=fr_CH.utf8
echo $\"system boot\"
démarrage système
I've played a little bit with this feature and this is what I came up with: you can include the newline verbatim as:
$ echo $"Written by %s.
> "
Écrit par %s.
$
In a script:
#!/bin/bash
message=$"Written by %s.
"
printf "$message" Gniourf
This script will output:
Écrit par Gniourf.
Ok, this is not really an answer, but it might help a little bit (at least, we're not using the evil eval
).
Personal remark: I find this feature really clunky!