coreutils
[Top][All Lists]
Advanced

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

Re: feature request: echo --


From: Leslie S Satenstein
Subject: Re: feature request: echo --
Date: Sat, 16 Oct 2021 00:36:50 +0000 (UTC)

I just use  printf "%s\n" "-e"-e

Regards 
 Leslie
 Leslie Satenstein
Montréal Québec, Canada

 

    On Friday, October 15, 2021, 06:38:19 p.m. GMT-4, Philip Rowlands 
<phr+coreutils@dimebar.com> wrote:  
 
 On Fri, 15 Oct 2021, at 18:42, Roger Pack wrote:
> It came to my attention recently that it seems not possible to "echo" the
> string "-e"
> $ echo "-e"

Nitpick: the double quotes aren't doing anything here.

> Perhaps echo could add a "--" style param like
>
> $ echo -- -e

These are both covered by the documentation
https://www.gnu.org/software/coreutils/manual/html_node/echo-invocation.html

"... the normally-special argument ‘--’ has no special meaning and is treated 
like any other string."

"If the POSIXLY_CORRECT environment variable is set, then when echo’s first 
argument is not -n it outputs option-like arguments instead of treating them as 
options."

Thus the way to make this work is:

$ POSIXLY_CORRECT=1 /bin/echo -e
-e


Cheers,
Phil

  

reply via email to

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