coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] doc: printf: make "java" encoding example more standard


From: Kaz Kylheku
Subject: Re: [PATCH] doc: printf: make "java" encoding example more standard
Date: Fri, 28 Oct 2022 07:50:52 -0700
User-agent: Roundcube Webmail/1.4.13

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

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