On Mon, Feb 6, 2017 at 12:15 PM, Jyoti B Tenginakai <jyoti....@in.ibm.com> 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.