zsh-users
 help / color / mirror / code / Atom feed
* bug in zsh-2.6-beta21
@ 1996-06-25 18:55 Vincent Lefevre
  1996-06-25 19:11 ` Zoltan Hidvegi
  0 siblings, 1 reply; 4+ messages in thread
From: Vincent Lefevre @ 1996-06-25 18:55 UTC (permalink / raw)
  To: zsh-users

I've just installed zsh 2.6-beta21 and found the following bug:

Under zsh 2.6-beta20:

$ var=`echo "ab\ncd\nef"`
$ echo $var
ab
cd
ef
$ var=`echo "ab\ncd\nef\n"`
$ echo $var
ab
cd
ef

$

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.

Regards,

Vincent Lefevre.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bug in zsh-2.6-beta21
  1996-06-25 18:55 bug in zsh-2.6-beta21 Vincent Lefevre
@ 1996-06-25 19:11 ` Zoltan Hidvegi
  1996-06-25 19:43   ` Vincent Lefevre
       [not found]   ` <hzoli@cs.elte.hu>
  0 siblings, 2 replies; 4+ messages in thread
From: Zoltan Hidvegi @ 1996-06-25 19:11 UTC (permalink / raw)
  To: vlefevre; +Cc: zsh-users

Vincent Lefevre wrote:
> [...] 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.

All other shells strip trailing newlines from command substitution and
POSIX requires this behaviour.  So far zsh stripped only one trailing
newline now it strips all.  But if the opposition of this change is big
enough I may change it back.  I thought that this change will be mostly
unnoticeable and I hope that it won't break any scripts.

Zoltan



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bug in zsh-2.6-beta21
  1996-06-25 19:11 ` Zoltan Hidvegi
@ 1996-06-25 19:43   ` Vincent Lefevre
       [not found]   ` <hzoli@cs.elte.hu>
  1 sibling, 0 replies; 4+ messages in thread
From: Vincent Lefevre @ 1996-06-25 19:43 UTC (permalink / raw)
  To: Zoltan Hidvegi; +Cc: vlefevre, zsh-users

Thanks for the information.

I wanted to "evaluate a variable with echo", e.g. to replace "\n" with
a newline character... I had something like this:
a="blah\nblah\n"
b=`echo $a`

With zsh 2.6-beta21, I changed the second line:
b=`echo ${a}+`
and I use $b[1,-2] instead of $b.

With this method, the last "\n" is not stripped.
Is there a better (recommended) method to do this?

Vincent Lefevre.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bug in zsh-2.6-beta21
       [not found]   ` <hzoli@cs.elte.hu>
@ 1996-06-25 19:52     ` Barton E. Schaefer
  0 siblings, 0 replies; 4+ messages in thread
From: Barton E. Schaefer @ 1996-06-25 19:52 UTC (permalink / raw)
  To: zsh-users

On Jun 25,  9:11pm, Zoltan Hidvegi wrote:
} Subject: Re: bug in zsh-2.6-beta21
}
} All other shells strip trailing newlines from command substitution and
} POSIX requires this behaviour.  But if the opposition of this change is
} big enough I may change it back.

I think it's fine the way it is now.

-- 
Bart Schaefer                     Vice President, Technology, Z-Code Software
schaefer@z-code.com                   Division of NetManage Corporation
http://www.well.com/www/barts           http://www.ncdsoft.com/ZMail/



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1996-06-25 20:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-06-25 18:55 bug in zsh-2.6-beta21 Vincent Lefevre
1996-06-25 19:11 ` Zoltan Hidvegi
1996-06-25 19:43   ` Vincent Lefevre
     [not found]   ` <hzoli@cs.elte.hu>
1996-06-25 19:52     ` Barton E. Schaefer

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).