zsh-workers
 help / color / mirror / code / Atom feed
From: Hrvoje Niksic <hniksic@srce.hr>
To: zsh-workers@math.gatech.edu (ZSH Workers Mailing List)
Subject: Re: bug in zsh-2.6-beta21
Date: 25 Jun 1996 21:15:55 +0200	[thread overview]
Message-ID: <kigd92noftg.fsf@jagor.srce.hr> (raw)
In-Reply-To: Vincent Lefevre's message of Tue, 25 Jun 1996 20:55:26 +0200 (MET DST)

Vincent Lefevre (Vincent.Lefevre@lip.ens-lyon.fr) wrote:
> This is OK. But under zsh 2.6-beta21:
> 
> $ var=`echo "ab\ncd\nef"`
> $ echo $var
> ab
> cd
> ef
> $ var=`echo "ab\ncd\nef\n"`
> $ echo $var
> ab
> cd
> ef
> $
> 
> The last "\n" is not printed.

I think this is good behaviour sh, ksh and bash also strip trailing
newlines. It should maybe be documented in the manual. E.g. bash
manual states:
              $(command)
       or
              `command`
       Bash performs  the  expansion  by  executing  command  and
       replacing  the command substitution with the standard out-
       put of the command, with any trailing newlines deleted.

Whereas zsh manual says:
       A  command  enclosed  in  parentheses preceded by a dollar
       sign, like so: $(...) or quoted with grave accents:  `...`
       is replaced with its standard output.  If the substitution
       is not enclosed in double quotes,  the  output  is  broken
       into  words  using  the  IFS  parameter.  The substitution

Removing trailing newlines is *not* specifically mentioned.

-- 
hniksic@srce.hr              |  Student of electrical engineering
hniksic@fly.cc.fer.hr        |  University of Zagreb, Croatia
------------------------------------------------------------------
`VI' - An editor used by those heretics that don't subscribe to
       the Emacs religion.



       reply	other threads:[~1996-06-25 19:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <199606251855.UAA03602@woodstock.ens-lyon.fr>
1996-06-25 19:15 ` Hrvoje Niksic [this message]
1996-06-21 14:29 Bug " alain (a.) caron
1996-07-01  8:22 ` Peter Stephenson
1996-07-04 13:43   ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=kigd92noftg.fsf@jagor.srce.hr \
    --to=hniksic@srce.hr \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).