Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Parameter expansion bug?

Bart Schaefer (schaefer@xxxxxxxxxxxxxxxxxxxxxxx) wrote:
> On Oct 31,  5:12pm, Zoltan Hidvegi wrote:
> } Subject: Re: Parameter expansion bug?
> }
> } In zsh echo - does not print anything and echo - -n prints -n.  How do you
> } print -n under bash?
> As nearly as I can tell, `echo -e -n` is the only way.

It doesn't work for me:

bash$ echo $BASH_VERSION 
bash$ echo -e -n

`-e' in bash is used to enable interpretation of control sequences
like \n.

       echo [-neE] [arg ...]
              Output the args, separated by spaces.   The  return
              status is always 0.  If -n is specified, the trail-
              ing newline is suppressed.  If  the  -e  option  is
              given,  interpretation  of the following backslash-
              escaped characters is enabled.  The -E option  dis-
              ables  the  interpretation  of these escape charac-
              ters, even on systems where they are interpreted by
[... list of control sequences snipped ...]

As far as I can see, no way is described to print `-n'.

WWW:          World-Wide-Waste.  Waste management corporation, which
              handles the billions of tons of garbage generated by just
              about everybody these days.
You owe the Oracle a good book.  In HyperText, please.

Messages sorted by: Reverse Date, Date, Thread, Author