From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id FAA12923 for ; Wed, 26 Jun 1996 05:31:42 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id PAA28124; Tue, 25 Jun 1996 15:17:50 -0400 (EDT) Resent-Date: Tue, 25 Jun 1996 15:17:50 -0400 (EDT) Sender: hniksic@public.srce.hr To: zsh-workers@math.gatech.edu (ZSH Workers Mailing List) Subject: Re: bug in zsh-2.6-beta21 References: <199606251855.UAA03602@woodstock.ens-lyon.fr> From: Hrvoje Niksic Date: 25 Jun 1996 21:15:55 +0200 In-Reply-To: Vincent Lefevre's message of Tue, 25 Jun 1996 20:55:26 +0200 (MET DST) Message-ID: X-Mailer: Gnus v5.2.25/XEmacs 19.14 Resent-Message-ID: <"5E8p-.0.Mt6.Uj3qn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1443 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu 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.