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

Re: Bug#490605: debian-policy: please discourage the usage of echo -n, and echo in general



On Thu, Jun 04 2009, Giacomo Catenazzi wrote:

> Raphael Geissert wrote:
>> On Tuesday 02 June 2009 12:54:00 Bill Allombert wrote:
>> [...]
>>> It does not make sense to policy to discourage "echo -n". Policy
>>> could deprecate it in favor of something else, but I do not see any
>>> alternative mentioned in this bug report, and otherwise discouraging
>>> "echo -n" would amount to discourage shell scripts to display lines
>>> that does not end by a newline, while Policy 9.4. mandates that init
>>> scripts display "Starting foo" without an ending newline.
>>> Furthermore, adding vague recommendation to policy is a waste of
>>> resource.

>>> So, is there an alternative to "echo -n" that you would like to
>>> recommends, and are you willing to do the job to make sure that all
>>> "Debian sh"-compliant shells in Debian support it ?

> I think we could forbid "echo -n" on maintainer and other scripts, but
> allow it on init.d scripts.  Rationale:
> - portability is more important on other scripts, and it is also not so
>   frequent to use echo -n
> - init.d are system scripts which special requirement, so they are not
>   portable. And we could ev. workaround with a special alias/path
>   which set a non-portable echo. This is also simple because
>   init.d scripts sould be called only by/via few programs/

        I am kinda missing the rationale for the policy change here.  At
 this point, forbidding it in one palce and not the other would not make
 life any easier for shells that want to be in /etc/shells, and making a
 policy change seems mostly random churn to me. Yes, echo -n maybehave
 differently in different shells, and it is undefined in POSIX, perhaps,
 but all shells in Debian have a specific interpretation of -n that all
 scripts may rely on.

        Is there a compelling reason  to change policy? If so, what is
 it?  From the report, it seems like more of a dev-ref thing;
 recommending some practice is better than others "for portability". I
 am not seeing yet why this belongs in policy and not dev-ref.

>> Yes, printf.
>
> It is not an alternative:
> - It is ugly

        This is mostly irrelevant.  If it is technically superior, it
 would not matter if it offends your sense of aesthetics; it might not
 offend other people.

> - it is not on root partition

        Point.

> The ugly part it is IMHO the most important part.  Most of people
> understand "echo -n", but I don't know if all people understand fully
> printf.  Mixing echo and printf is ugly.

        People who can't learn something as simple as printf should not
 be allowed to write maintainer scripts or init scripts.


        manoj
-- 
War is delightful to those who have had no experience of it. Desiderius
Erasmus
Manoj Srivastava <srivasta@debian.org> <http://www.debian.org/~srivasta/>  
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C


Reply to: