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

Re: zsh-4.2.1: LINENO lost in evals



On Wed, 1 Sep 2004, Peter Stephenson wrote:

> "Dieter Lambrecht" wrote:
> >#! /bin/zsh -x
> 
> (There must be a set -x or setopt xtrace lurking somewhere.)

Welcome back, Peter. :-)

> It's not actually lost, it's showing you the line in the eval.  That's
> a feature (compare error messages from Perl evals, which is where we
> pinched the output format from).

The thing is, Perl has two kinds of "eval":

schaefer[676] perl <<\EOF
print __LINE__."\n";
eval 'print __LINE__."\n"';
eval { print __LINE__."\n"; };
EOF
1
1
3

The kind in braces, which gets precompiled, behaves differently than the 
kind in quotes.  Zsh only has the kind in quotes.



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