On 2022-10-28 06:54, Pádraig Brady wrote:
> Note using iconv(1) rather than recode(1) is not appropriate
> for this example, as the required functionality is only
> available on libiconv's iconv implementation, which is
> not installed on most systems.

Note that there is an iconv in POSIX; recode is nonstandard.

> * doc/coreutils.texi (printf invocation): Use env rather than
> /usr/local/bin for the printf command.  Escape '%' so more robust.
> Also use a locale that exists on modern systems.

Why would you need env in a shell script, except in the
hash bang line? The command interpreter is already searching PATH
for commands. The other features of env like setting up environment
variables is done in shell syntax, which the example is doing:

  LC_CTYPE=zh_TW.big5 env printf ...
  ^^^^^^^^^^^^^^^^^^^

Moreover, here, PATH search takes place to find env. If PATH
resolution weren't working (so that we had to use env), we would
have to call it as /usr/bin/env.

Reply via email to