The gettext.sh approach (GNU gettext utilities)

Next: , Previous: , Up: sh - Shell Script [Contents][Index]


16.5.15.2 The gettext.sh approach

This approach uses shell functions defined in the gettext.sh file.

Here’s an example that references a shell variable pid:

eval_gettext "Running as process number \$pid."; echo

A ready-to-use example is available in the hello-1.sh file in the examples/hello-sh directory.

Contents of gettext.sh

gettext.sh, contained in the run-time package of GNU gettext, provides the following:

$echo

The variable echo is set to a command that outputs its first argument and a newline, without interpreting backslashes in the argument string.

eval_gettext

See Invoking the eval_gettext function.

eval_ngettext

See Invoking the eval_ngettext function.

eval_pgettext

See Invoking the eval_pgettext function.

eval_npgettext

See Invoking the eval_npgettext function.

Advantages and Drawbacks

Advantages:

Drawbacks:


Next: The printf approach, Previous: Three approaches for Shell Scripts, Up: sh - Shell Script [Contents][Index]

AltStyle によって変換されたページ (->オリジナル) /