bug-bash
[Top][All Lists]
Advanced

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

Re: echo -n


From: Peter & Kelly Passchier
Subject: Re: echo -n
Date: Mon, 6 Feb 2017 14:27:02 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1

Depending on your use case, you could do something like:
$ echo $'\u2010'n
-n

On 06/02/2560 13:37, Clark Wang wrote:
> On Mon, Feb 6, 2017 at 12:15 PM, Jyoti B Tenginakai
> <jyoti.b.t@in.ibm.com <mailto:jyoti.b.t@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.
> 
>



reply via email to

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