Re: [PATCH 1/2] git-sh-i18n--envsubst: our own envsubst(1) for eval_gettext()
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Apr 10, 2011, 22:43 UTC
- Message-ID
- <BANLkTimjkuvOc4mS4hfC7PiGWrRAb_2uog@mail.gmail.com>
- In-Reply-To
- <7voc4ncg0l.fsf@alter.siamese.dyndns.org>
On Sun, Apr 3, 2011 at 21:05, Junio C Hamano <gitster@pobox.com> wrote:
Show 5 quoted lines
> Perhaps it is not an issue in real life; after all eval_gettext interface > is not something you invented in 5 minutes without thinking deeply, but is > what you plan to use from outside codebase that presumably has seen a wide > use in the field, and it may be just that I am worried too much about an > implausible corner case, but I thought I should bring it up.
It's a corner case, but if we run into it we can easily solve it like this:
#!/bin/sh
. gettext.sh HOME=/home/junio
path='$HOME/.gitconfig'
var=core.i18n
(
export HOME var ;# no need for HOME, but just an illustration
# TRANSLATORS: $path will be "$HOME/.gitconfig"
eval_gettext 'Look at $path and find definition of $var variable.'; echo
)Which results in:
$ sh /tmp/foo.sh
Look at $HOME/.gitconfig and find definition of core.i18n variable.