bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug#279992: xgettext misparses Bash source using "eval_gettext" and


From: Bruno Haible
Subject: Re: Bug#279992: xgettext misparses Bash source using "eval_gettext" and the `'' character (fwd)
Date: Mon, 15 Nov 2004 13:36:09 +0100
User-agent: KMail/1.5

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.

> Maybe the shell parser in x-sh.c of the gettext-tools is a bit broken?

No, but the Advanced Bash Scripting Guide needs a fix, and gettext's
documentation is too silent about this backslash stuff.

Thanks for the report.

Bruno





reply via email to

[Prev in Thread] Current Thread [Next in Thread]