[Top][All Lists]

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

Re: echo -n

From: Clark Wang
Subject: Re: echo -n
Date: Mon, 6 Feb 2017 14:37:28 +0800

On Mon, Feb 6, 2017 at 12:15 PM, Jyoti B Tenginakai <address@hidden> wrote:

Thanks you all,

Again I see that this printf we can use. But there are some scenarios where the o/p does not exactly match with echo. So still its good to have a way to pirnt -n /-e/-E with echo. Can this be considered as bug and can this be fixed?

It’s not a bug. According to POSIX.1-2008:

The echo utility shall not recognize the "--" argument in the manner specified by Guideline 10 of XBD Section 12.2; "− −" shall be recognized as a string operand.

It is not possible to use echo portably across all POSIX systems unless both −n (as the first argument) and escape sequences are omitted.

The echo utility has not been made obsolescent because of its extremely widespread use in historical applications.

reply via email to

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