[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug#279992: xgettext misparses Bash source using "eval_gettext" and
Re: Bug#279992: xgettext misparses Bash source using "eval_gettext" and the `'' character (fwd)
Mon, 15 Nov 2004 14:11:30 +0100
On Mon, Nov 15, 2004 at 01:36:09PM +0100, Bruno Haible wrote:
> Alfredo <address@hidden> wrote:
> > from the Advanced Bash Scripting Guide:
> > error "`eval_gettext \"Can't cd to \$var.\"`"
> > using xgettext to extract this string doesn't work
> Indeed. This is because the backquote removes one level of backslashes,
> therefore the inner command actually is
> eval_gettext "Can't cd to $var."
> So it substitutes var into the string before passing it to eval_gettext;
> this won't work. The inner command has to read
> eval_gettext "Can't cd to \$var."
> therefore the complete command is
> error "`eval_gettext \"Can't cd to \\\$var.\"`"
> and now xgettext extracts it as expected.
Actually, because there is no portable way to use a double-quoted
string inside a double-quoted `...` command substitution, you should
x=`eval_gettext "Can't cd to \$var."`
See the end of
and the top of the 'Shell Substitutions' section of the Autoconf manual.